From 6b04630e99d63e5c260788da2aeef08fc85d390e Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 4 Sep 2012 15:56:42 +0200 Subject: [PATCH] Fixed a wrong assumption about the parent directory of a test module being the top level. --- README.rst | 7 +++++++ discover_runner/runner.py | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f553516..1b8137c 100644 --- a/README.rst +++ b/README.rst @@ -131,6 +131,13 @@ Other than that it's similar to the new project's style configuration. 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 ^^^^^^^^^^^^^^^^ diff --git a/discover_runner/runner.py b/discover_runner/runner.py index aa2ed3f..29e2298 100644 --- a/discover_runner/runner.py +++ b/discover_runner/runner.py @@ -1,4 +1,3 @@ -import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase @@ -34,7 +33,6 @@ class DiscoverRunner(DjangoTestSuiteRunner): if not suite.countTestCases() and len(test_labels) == 1: suite = None root = import_module(test_labels[0]).__path__[0] - top_level = os.path.dirname(root) if suite is None: suite = defaultTestLoader.discover(root,