From a127fe31abe49487b0630efd9e75462ed17ded5c Mon Sep 17 00:00:00 2001
From: aarif <mraarif@outlook.com>
Date: Tue, 3 Dec 2019 14:30:00 +0500
Subject: [PATCH] Added pytest

made changes as suggested

removed django_nose
---
 pytest.ini               |  6 ++++++
 requirements/dev.txt     | 19 ++++++++++++-------
 requirements/quality.txt | 29 +++++++++++++++++++++--------
 requirements/test.in     |  5 +++--
 requirements/test.txt    | 22 +++++++++++++++++++---
 requirements/travis.txt  |  6 +++---
 settings.py              |  5 +----
 tox.ini                  |  2 +-
 8 files changed, 66 insertions(+), 28 deletions(-)
 create mode 100644 pytest.ini

diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 00000000..56c7997b
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,6 @@
+[pytest]
+DJANGO_SETTINGS_MODULE = settings
+addopts = --cov . --cov-report term-missing --cov-report html
+norecursedirs = .git .tox .* CVS _darcs {arch} *.egg
+
+testpaths = milestones
\ No newline at end of file
diff --git a/requirements/dev.txt b/requirements/dev.txt
index ff603a73..9f2708b2 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -6,9 +6,11 @@
 #
 argparse==1.4.0
 astroid==1.6.6
+atomicwrites==1.3.0
+attrs==19.3.0
 backports.functools-lru-cache==1.6.1
 caniusepython3==7.2.0
-certifi==2019.9.11
+certifi==2019.11.28
 chardet==3.0.4
 click-log==0.3.2
 click==7.0
@@ -19,22 +21,21 @@ contextlib2==0.6.0.post1
 coverage==4.5.4
 distlib==0.3.0
 django-model-utils==3.2.0
-django-nose==1.4.6
 django==1.11.26
 edx-lint==1.4.1
 edx-opaque-keys==2.0.1
 enum34==1.1.6
 filelock==3.0.12
+funcsigs==1.0.2
 futures==3.3.0 ; python_version == "2.7"
 idna==2.8
-importlib-metadata==0.23
+importlib-metadata==1.1.0
 isort==4.3.21
 jinja2==2.10.3
 lazy-object-proxy==1.4.3
 markupsafe==1.1.1
 mccabe==0.6.1
 more-itertools==5.0.0
-nose==1.3.7
 packaging==19.2
 pathlib2==2.3.5
 pbr==5.4.4
@@ -49,9 +50,12 @@ pylint-plugin-utils==0.6
 pylint==1.9.5
 pymongo==3.9.0
 pyparsing==2.4.5
+pytest-cov==2.8.1
+pytest-django==3.7.0
+pytest==4.6.6
 python-slugify==4.0.0
 pytz==2019.3
-pyyaml==5.1.2
+pyyaml==5.2
 requests==2.22.0
 scandir==1.10.0
 singledispatch==3.4.0.3
@@ -61,11 +65,12 @@ stevedore==1.31.0
 text-unidecode==1.3
 toml==0.10.0
 tox-battery==0.5.1
-tox==3.14.1
+tox==3.14.2
 urllib3==1.25.7
 virtualenv==16.7.8
+wcwidth==0.1.7
 wrapt==1.11.2
 zipp==0.6.0
 
 # The following packages are considered to be unsafe in a requirements file:
-# setuptools==42.0.1        # via caniusepython3
+# setuptools
diff --git a/requirements/quality.txt b/requirements/quality.txt
index edd00f71..5d7d538e 100644
--- a/requirements/quality.txt
+++ b/requirements/quality.txt
@@ -6,32 +6,39 @@
 #
 argparse==1.4.0           # via caniusepython3
 astroid==1.6.6            # via pylint, pylint-celery
+atomicwrites==1.3.0
+attrs==19.3.0
 backports.functools-lru-cache==1.6.1  # via astroid, caniusepython3, isort, pylint
 caniusepython3==7.2.0
-certifi==2019.9.11        # via requests
+certifi==2019.11.28       # via requests
 chardet==3.0.4            # via requests
 click-log==0.3.2          # via edx-lint
 click==7.0
 code-annotations==0.3.2
-configparser==4.0.2       # via pydocstyle, pylint
+configparser==4.0.2
+contextlib2==0.6.0.post1
 coverage==4.5.4
 distlib==0.3.0            # via caniusepython3
 django-model-utils==3.2.0
-django-nose==1.4.6
 django==1.11.26
 edx-lint==1.4.1
 edx-opaque-keys==2.0.1
 enum34==1.1.6             # via astroid
+funcsigs==1.0.2
 futures==3.3.0 ; python_version == "2.7"  # via caniusepython3, isort
 idna==2.8                 # via requests
+importlib-metadata==1.1.0
 isort==4.3.21
 jinja2==2.10.3
 lazy-object-proxy==1.4.3  # via astroid
 markupsafe==1.1.1
 mccabe==0.6.1             # via pylint
-nose==1.3.7
-packaging==19.2           # via caniusepython3
+more-itertools==5.0.0
+packaging==19.2
+pathlib2==2.3.5
 pbr==5.4.4
+pluggy==0.13.1
+py==1.8.0
 pycodestyle==2.5.0
 pydocstyle==3.0.0
 pylint-celery==0.3        # via edx-lint
@@ -39,18 +46,24 @@ pylint-django==0.11.1     # via edx-lint
 pylint-plugin-utils==0.6  # via pylint-celery, pylint-django
 pylint==1.9.5             # via edx-lint, pylint-celery, pylint-django, pylint-plugin-utils
 pymongo==3.9.0
-pyparsing==2.4.5          # via packaging
+pyparsing==2.4.5
+pytest-cov==2.8.1
+pytest-django==3.7.0
+pytest==4.6.6
 python-slugify==4.0.0
 pytz==2019.3
-pyyaml==5.1.2
+pyyaml==5.2
 requests==2.22.0          # via caniusepython3
+scandir==1.10.0
 singledispatch==3.4.0.3   # via astroid, pylint
 six==1.13.0
 snowballstemmer==2.0.0    # via pydocstyle
 stevedore==1.31.0
 text-unidecode==1.3
 urllib3==1.25.7           # via requests
+wcwidth==0.1.7
 wrapt==1.11.2             # via astroid
+zipp==0.6.0
 
 # The following packages are considered to be unsafe in a requirements file:
-# setuptools==42.0.1        # via caniusepython3
+# setuptools
diff --git a/requirements/test.in b/requirements/test.in
index 5bbba777..df1d1b22 100644
--- a/requirements/test.in
+++ b/requirements/test.in
@@ -5,5 +5,6 @@
 
 code-annotations          # Provides commands used by the pii_check make target
 coverage
-django_nose>=1.4.1
-nose
+pytest
+pytest-django
+pytest-cov
diff --git a/requirements/test.txt b/requirements/test.txt
index 6ef7a7bd..2a1fbef1 100644
--- a/requirements/test.txt
+++ b/requirements/test.txt
@@ -4,20 +4,36 @@
 #
 #    make upgrade
 #
+atomicwrites==1.3.0       # via pytest
+attrs==19.3.0             # via pytest
 click==7.0                # via code-annotations
 code-annotations==0.3.2
+configparser==4.0.2       # via importlib-metadata
+contextlib2==0.6.0.post1  # via importlib-metadata
 coverage==4.5.4
 django-model-utils==3.2.0
-django-nose==1.4.6
 edx-opaque-keys==2.0.1
+funcsigs==1.0.2           # via pytest
+importlib-metadata==1.1.0  # via pluggy, pytest
 jinja2==2.10.3            # via code-annotations
 markupsafe==1.1.1         # via jinja2
-nose==1.3.7
+more-itertools==5.0.0     # via pytest, zipp
+packaging==19.2           # via pytest
+pathlib2==2.3.5           # via importlib-metadata, pytest, pytest-django
 pbr==5.4.4
+pluggy==0.13.1            # via pytest
+py==1.8.0                 # via pytest
 pymongo==3.9.0
+pyparsing==2.4.5          # via packaging
+pytest-cov==2.8.1
+pytest-django==3.7.0
+pytest==4.6.6
 python-slugify==4.0.0     # via code-annotations
 pytz==2019.3
-pyyaml==5.1.2             # via code-annotations
+pyyaml==5.2               # via code-annotations
+scandir==1.10.0           # via pathlib2
 six==1.13.0
 stevedore==1.31.0
 text-unidecode==1.3       # via python-slugify
+wcwidth==0.1.7            # via pytest
+zipp==0.6.0               # via importlib-metadata
diff --git a/requirements/travis.txt b/requirements/travis.txt
index aa9a007e..89435f1a 100644
--- a/requirements/travis.txt
+++ b/requirements/travis.txt
@@ -4,7 +4,7 @@
 #
 #    make upgrade
 #
-certifi==2019.9.11        # via requests
+certifi==2019.11.28       # via requests
 chardet==3.0.4            # via requests
 codecov==2.0.15
 configparser==4.0.2       # via importlib-metadata
@@ -12,7 +12,7 @@ contextlib2==0.6.0.post1  # via importlib-metadata
 coverage==4.5.4           # via codecov
 filelock==3.0.12          # via tox
 idna==2.8                 # via requests
-importlib-metadata==0.23  # via pluggy, tox
+importlib-metadata==1.1.0  # via pluggy, tox
 more-itertools==5.0.0     # via zipp
 packaging==19.2           # via tox
 pathlib2==2.3.5           # via importlib-metadata
@@ -24,7 +24,7 @@ scandir==1.10.0           # via pathlib2
 six==1.13.0               # via more-itertools, packaging, pathlib2, tox
 toml==0.10.0              # via tox
 tox-battery==0.5.1
-tox==3.14.1
+tox==3.14.2
 urllib3==1.25.7           # via requests
 virtualenv==16.7.8        # via tox
 zipp==0.6.0               # via importlib-metadata
diff --git a/settings.py b/settings.py
index d0310396..d9339869 100644
--- a/settings.py
+++ b/settings.py
@@ -7,7 +7,6 @@
 from __future__ import unicode_literals
 DEBUG = True
 TEST_MODE = True
-TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
 TRANSACTIONS_MANAGED = {}
 USE_TZ = False
 TIME_ZONE = {}
@@ -26,9 +25,7 @@
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.messages',
-
-    'milestones',
-    'django_nose',
+    'milestones'
 )
 
 MIDDLEWARE_CLASSES = {}
diff --git a/tox.ini b/tox.ini
index f8633602..b1c31948 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,7 @@ deps =
     -r{toxinidir}/requirements/test.txt
 
 commands =
-    coverage run manage.py test --verbosity=3
+    python -Wd -m pytest {posargs}
     coverage report -m
     coverage html