Switch to pytest for unit tests
This commit is contained in:
8
common/lib/conftest.py
Normal file
8
common/lib/conftest.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def pytest_configure():
|
||||
"""
|
||||
Use Django's default settings for tests in common/lib.
|
||||
"""
|
||||
settings.configure()
|
||||
5
common/lib/pytest.ini
Normal file
5
common/lib/pytest.ini
Normal file
@@ -0,0 +1,5 @@
|
||||
[pytest]
|
||||
addopts = --nomigrations --reuse-db --durations=20
|
||||
norecursedirs = .cache
|
||||
python_classes =
|
||||
python_files = tests.py test_*.py tests_*.py *_tests.py __init__.py
|
||||
@@ -13,12 +13,6 @@ import uuid
|
||||
import ddt
|
||||
from contracts import contract
|
||||
from nose.plugins.attrib import attr
|
||||
# For the cache tests to work, we need to be using the Django default
|
||||
# settings (not our usual cms or lms test settings) and they need to
|
||||
# be configured before importing from django.core.cache
|
||||
from django.conf import settings
|
||||
if not settings.configured:
|
||||
settings.configure()
|
||||
from django.core.cache import caches, InvalidCacheBackendError
|
||||
|
||||
from openedx.core.lib import tempdir
|
||||
|
||||
Reference in New Issue
Block a user