1

I have all of my TestCase files in a django app called 'tests'. Running a specific TestCase works just fine with this command:

python run manage.py test tests.myTestCaseFile

However, when i run the entire set of TestCases in the tests folder this fails:

python run manage.py test tests

In this case many ImportErrors are triggered as well as KeyError: 'en-us'. Essentially every single TestMethod errors out in one way or another.

Any ideas what could be happening here?

NOTE: I have already tried to import myapp.urls in the shell and reverse(urlname) works just fine there..

DannyMoshe
  • 6,023
  • 4
  • 31
  • 53
  • 1
    Do you see the same effect if you compare `python manage.py test tests.myTestCaseFile` to `python manage.py test tests` ? Is coverage an essential factor in the problem? – Ned Batchelder Mar 08 '19 at 23:45
  • No it's not - thanks for pointing this out. Seems the root cause is something within the django-nose loader. Still troubleshooting on that end. I removed references to coverage. – DannyMoshe Mar 09 '19 at 00:10

1 Answers1

3

I've solved this issue:

  • KeyError: u'en-us' seems to occur anytime there is an import error in any test module

I had a test file which was testing functionality that did not exist in the current branch.

Seems that an import error in any test file prevents execution of the entire test suite.

DannyMoshe
  • 6,023
  • 4
  • 31
  • 53