Fixed a wrong assumption about the parent directory of a test module being the top level.

This commit is contained in:
Jannis Leidel 2012-09-04 15:56:42 +02:00
parent a5a7c2b433
commit 6b04630e99
2 changed files with 7 additions and 2 deletions

View File

@ -131,6 +131,13 @@ Other than that it's similar to the new project's style configuration.
Changelog Changelog
--------- ---------
0.2.2 09/04/2012
^^^^^^^^^^^^^^^^
* Stopped setting the top level variable in the case of using a module path
as the test label as it made the wrong assumption that the parent directory
*is* the top level.
0.2.1 08/20/2012 0.2.1 08/20/2012
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,3 @@
import os
from django.conf import settings from django.conf import settings
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase from django.test import TestCase
@ -34,7 +33,6 @@ class DiscoverRunner(DjangoTestSuiteRunner):
if not suite.countTestCases() and len(test_labels) == 1: if not suite.countTestCases() and len(test_labels) == 1:
suite = None suite = None
root = import_module(test_labels[0]).__path__[0] root = import_module(test_labels[0]).__path__[0]
top_level = os.path.dirname(root)
if suite is None: if suite is None:
suite = defaultTestLoader.discover(root, suite = defaultTestLoader.discover(root,