Does 3 things: (1) Use django for modulestore tests (2) Use normal LMS settings for modulestore tests instead of openedx/tests/settings.py (3) Simplify some TestCase subclasses by converting them to use ModuleStoreTestCase Details and rationale: (1) Currently parts of the modulestore test suite are designed to run "without django", although there is still a lot of django functionality imported at times, and many of the tests do in fact use django. But for the upcoming PR #27565 (moving split's course indexes from MongoDB to MySQL), we will need to always have Django enabled. So this commit paves the way for that change. (2) The previous tests that did use Django used a special settings file, openedx/tests/settings.py which made some debugging confusing because those tests had quite different django settings than other tests. This change deletes that file and runs the tests using the LMS test settings. (3) The test suite also contains many different ways of initializing and testing a modulestore, with significant differences in their configuration, and also a lot of repetition. I find this makes understanding, debugging and writing tests more difficult. So this commit also reduces the number of different "test case using modulestore" base classes: * Simplifies MixedWithOptionsTestCase and MixedSplitTestCase by making them simple subclasses of ModuleStoreTestCase. * Removes PureModulestoreTestCase.
17 lines
859 B
INI
17 lines
859 B
INI
[pytest]
|
|
# Use the LMS settings for these tests; should work with CMS just as well though:
|
|
DJANGO_SETTINGS_MODULE = lms.envs.test
|
|
addopts = --nomigrations --reuse-db --durations=20 --json-report --json-report-omit keywords streams collectors log traceback tests --json-report-file=none
|
|
# Enable default handling for all warnings, including those that are ignored by default;
|
|
# but hide rate-limit warnings (because we deliberately don't throttle test user logins)
|
|
# and field_data deprecation warnings (because fixing them requires a major low-priority refactoring)
|
|
filterwarnings =
|
|
default
|
|
ignore:No request passed to the backend, unable to rate-limit:UserWarning
|
|
ignore::xblock.exceptions.FieldDataDeprecationWarning
|
|
markers =
|
|
mongo
|
|
norecursedirs = .cache
|
|
python_classes =
|
|
python_files = tests.py test_*.py tests_*.py *_tests.py __init__.py
|