#20449: New test runner test fails if run from a different directory
-----------------------------------+------------------------------------
     Reporter:  gcc                |                    Owner:  tadeck
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  master
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by nikl@…):

 * status:  closed => new
 * resolution:  fixed =>


Comment:

 Fixed in: https://github.com/django/django/pull/2657

 This also happens to the (newer) {{{test_testcase_ordering()}}} with the
 current master:
 {{{
 tests/runtests.py test_runner
 Testing against Django installed in '/home/dev/django/django/django'
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 .............E.ss.................
 ======================================================================
 ERROR: test_testcase_ordering
 (test_runner.test_discover_runner.DiscoverRunnerTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/dev/django/django/tests/test_runner/test_discover_runner.py", line
 107, in test_testcase_ordering
     suite = DiscoverRunner().build_suite(["test_discovery_sample/"])
   File "/home/dev/django/django/django/test/runner.py", line 66, in
 build_suite
     tests = self.test_loader.loadTestsFromName(label)
   File "/usr/lib/python2.7/unittest/loader.py", line 91, in
 loadTestsFromName
     module = __import__('.'.join(parts_copy))
 ImportError: Import by filename is not supported.

 ----------------------------------------------------------------------
 Ran 34 tests in 1.811s

 FAILED (errors=1, skipped=2)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 }}}

 which can be fixed by applying the already existing {{{with
 change_cwd(".."):}}} pattern - maybe this might be moved to {{{setUp()}}}?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20449#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.b0dd9a4c2ccde624f6c0219cfc69821a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to