The following examples are with nose in Django. With the nose test runner, usually all 3 examples below work, but with this package, only one of them works. I'd like to continue to use this package because I like the idea, but the inability to run single tests (as far as I know, correct me if I'm wrong) is a current limitation of this package. Also, it only accepts 1 type of below syntax for running a test class.
This works:
# run a test class with "nose
./manage.py test location.tests.test_views:LocationLevelTests
These do not work:
# run a test class with "nose
./manage.py test location.tests.test_views.LocationLevelTests
# run a single test with "nose"
./manage.py test location.tests.test_views:LocationLevelTests.test_create__name_unique_by_tenant
They result in the following error:
======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'LocationLevelTests')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/loader.py", line 552, in _makeTest
return self.suiteClass(plug_tests)
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/suite.py", line 425, in __call__
context = self.findContext(tests)
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/suite.py", line 463, in findContext
ctx = getattr(test, 'context', None)
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/case.py", line 101, in _context
return self.test.context
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/case.py", line 257, in _context
return resolve_name(self.test.__module__)
File "/Users/alelevier/Documents/bsrs/bsrs-django/venv/lib/python3.6/site-packages/nose/util.py", line 312, in resolve_name
module = __import__('.'.join(parts_copy))
ModuleNotFoundError: No module named 'LocationLevelTests'
The following examples are with
nosein Django. With thenosetest runner, usually all 3 examples below work, but with this package, only one of them works. I'd like to continue to use this package because I like the idea, but the inability to run single tests (as far as I know, correct me if I'm wrong) is a current limitation of this package. Also, it only accepts 1 type of below syntax for running a test class.This works:
These do not work:
They result in the following error: