Mark slow tests to be skipped if SKIP_SLOW_TESTS env var is defined

Saves over 100 seconds.
This commit is contained in:
Jesse Weinstein 2016-01-10 23:18:47 -08:00
parent dda1173e02
commit 760298b8e4
7 changed files with 24 additions and 0 deletions

View file

@ -261,6 +261,8 @@ class GoogleImageTest(UseThePlugin):
self.assertEqual(list(result_url), [])
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class ArtImporterTest(UseThePlugin):
def setUp(self):
super(ArtImporterTest, self).setUp()

View file

@ -64,6 +64,8 @@ class TestHelper(helper.TestHelper):
.format(path, tag))
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class ImportConvertTest(unittest.TestCase, TestHelper):
def setUp(self):
@ -99,6 +101,8 @@ class ImportConvertTest(unittest.TestCase, TestHelper):
self.assertTrue(os.path.isfile(item.path))
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class ConvertCliTest(unittest.TestCase, TestHelper):
def setUp(self):
@ -186,6 +190,8 @@ class ConvertCliTest(unittest.TestCase, TestHelper):
self.assertFalse(os.path.exists(converted))
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class NeverConvertLossyFilesTest(unittest.TestCase, TestHelper):
"""Test the effect of the `never_convert_lossy_files` option.
"""

View file

@ -127,6 +127,8 @@ class TestModelWithGetters(dbcore.Model):
return {}
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class MigrationTest(unittest.TestCase):
"""Tests the ability to change the database schema between
versions.

View file

@ -15,6 +15,7 @@
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import codecs
import os
from mock import patch
from test._common import unittest
@ -62,6 +63,8 @@ class ModifyFileMocker(object):
f.write(contents)
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class EditCommandTest(unittest.TestCase, TestHelper):
""" Black box tests for `beetsplug.edit`. Command line interaction is
simulated using `test.helper.control_stdin()`, and yaml editing via an

View file

@ -236,6 +236,8 @@ class ImportHelper(TestHelper):
self.assertEqual(len(os.listdir(self.libdir)), 0)
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class NonAutotaggedImportTest(_common.TestCase, ImportHelper):
def setUp(self):
self.setup_beets(disk=True)

View file

@ -5,6 +5,7 @@ from __future__ import (division, absolute_import, print_function,
unicode_literals)
import sys
import os
import threading
import logging as log
from StringIO import StringIO
@ -163,6 +164,8 @@ class LoggingLevelTest(unittest.TestCase, helper.TestHelper):
self.assertIn('dummy: debug import_stage', logs)
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class ConcurrentEventsTest(TestCase, helper.TestHelper):
"""Similar to LoggingLevelTest but lower-level and focused on multiple
events interaction. Since this is a bit heavy we don't do it in

View file

@ -594,6 +594,8 @@ class InputTest(_common.TestCase):
self.assertEqual(album, u'\xc2me')
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class ConfigTest(unittest.TestCase, TestHelper):
def setUp(self):
self.setup_beets()
@ -1035,6 +1037,8 @@ class PathFormatTest(_common.TestCase):
self.assertEqual(pf[1:], default_formats)
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class PluginTest(_common.TestCase):
def test_plugin_command_from_pluginpath(self):
config['pluginpath'] = [os.path.join(_common.RSRC, 'beetsplug')]
@ -1042,6 +1046,8 @@ class PluginTest(_common.TestCase):
ui._raw_main(['test'])
@unittest.skipIf('SKIP_SLOW_TESTS' in os.environ,
'Skipping because test is slow')
class CompletionTest(_common.TestCase):
def test_completion(self):
# Load plugin commands