From 045d37dcbcd9022bdd6e6c04563360307ea6367c Mon Sep 17 00:00:00 2001 From: Clinton Blackburn Date: Sun, 15 Jan 2017 01:13:12 -0500 Subject: [PATCH] Using pytest to run tests ECOM-6842 --- pytest.ini | 4 ++++ test_requirements.txt | 4 +++- test_settings.py | 3 --- tox.ini | 3 +-- 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..01cc4181 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +DJANGO_SETTINGS_MODULE=test_settings +addopts = --cov auth_backends --cov-report term-missing --cov-report xml +testpaths = auth_backends/tests diff --git a/test_requirements.txt b/test_requirements.txt index 81a5b20e..f4320822 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,9 +1,11 @@ coverage>=4.3.1,<5.0.0 ddt>=1.1.1,<2.0.0 -django-nose>=1.4.3,<2.0.0 edx-lint>=0.5.2,<1.0.0 httpretty>=0.8.14,<1.0.0 mock>=2.0.0,<3.0.0 pep8>=1.7.0,<2.0.0 +pytest-catchlog>=1.2.2,<2.0.0 +pytest-cov>=2.4.0,<3.0.0 +pytest-django>=3.1.2,<4.0.0 tox>=2.3.2,<3.0.0 unittest2>=1.1.0,<2.0.0 diff --git a/test_settings.py b/test_settings.py index d2be2a1a..1b6bd779 100644 --- a/test_settings.py +++ b/test_settings.py @@ -11,7 +11,6 @@ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', - 'django_nose', 'social.apps.django_app.default', 'auth_backends', ) @@ -38,8 +37,6 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' - SOCIAL_AUTH_EDX_OIDC_URL_ROOT = 'http://example.com' SOCIAL_AUTH_EDX_OIDC_KEY = 'dummy-key' SOCIAL_AUTH_EDX_OIDC_SECRET = 'dummy-secret' diff --git a/tox.ini b/tox.ini index 86d6584a..9b41c5eb 100644 --- a/tox.ini +++ b/tox.ini @@ -12,8 +12,7 @@ deps = -rtest_requirements.txt commands = - django-admin.py test auth_backends --settings=test_settings --with-coverage --cover-package=auth_backends - coverage report + pytest {posargs} [testenv:quality] commands =