Commit 5d1363b4 by John Eskew

fixup! Enable tox testing of system and commonlib via paver. Add support for…

fixup! Enable tox testing of system and commonlib via paver. Add support for django_version option to support Django 1.8/1.11.
parent 0ee41283
......@@ -75,27 +75,6 @@ def test_system(options, passthrough_options):
assert(system in (None, 'lms', 'cms'))
assert(django_version in (None, '1.8', '1.11'))
def _create_tox_system_test_suites(systems):
system_tests = []
test_paths = []
# Add all test directories for the specified systems.
for syst in systems:
test_paths.extend(suites.default_system_test_dirs(syst))
# Remove all duplicate paths.
test_paths = list(set(test_paths))
for test_id in test_paths:
system = test_id.split('/')[0]
syst = 'cms'
if system in ['common', 'openedx', 'lms']:
syst = 'lms'
system_tests.append(suites.SystemTestSuite(
syst,
passthrough_options=passthrough_options,
test_id=test_id,
**options.test_system
))
return system_tests
if test_id:
# Testing a single test ID.
# Ensure the proper system for the test id.
......@@ -115,16 +94,13 @@ def test_system(options, passthrough_options):
else:
# No specified system or test_id, so run all tests of both systems.
systems = ['cms', 'lms']
if django_version:
system_tests = _create_tox_system_test_suites(systems)
else:
system_tests = []
for syst in systems:
system_tests.append(suites.SystemTestSuite(
syst,
passthrough_options=passthrough_options,
**options.test_system
))
system_tests = []
for syst in systems:
system_tests.append(suites.SystemTestSuite(
syst,
passthrough_options=passthrough_options,
**options.test_system
))
test_suite = suites.PythonTestSuite(
'python tests',
......
......@@ -2,7 +2,7 @@
TestSuite class and subclasses
"""
from .suite import TestSuite
from .pytest_suite import PytestSuite, SystemTestSuite, LibTestSuite, default_system_test_dirs
from .pytest_suite import PytestSuite, SystemTestSuite, LibTestSuite
from .python_suite import PythonTestSuite
from .js_suite import JsTestSuite
from .acceptance_suite import AcceptanceTestSuite
......
......@@ -15,27 +15,6 @@ except ImportError:
__test__ = False # do not collect
def default_system_test_dirs(system):
"""
Return a list of all directories in which pytest should begin a search for tests.
"""
default_test_dirs = [
"{system}/djangoapps".format(system=system),
"common/djangoapps",
"openedx/core/djangoapps",
"openedx/tests",
"openedx/core/lib",
]
if system in ('lms', 'cms'):
default_test_dirs.append("{system}/lib".format(system=system))
if system == 'lms':
default_test_dirs.append("{system}/tests.py".format(system=system))
default_test_dirs.append("openedx/core/djangolib")
default_test_dirs.append("openedx/features")
return default_test_dirs
class PytestSuite(TestSuite):
"""
A subclass of TestSuite with extra methods that are specific
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment