﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22945	Creating a tests directory with __init__ breaks the testrunner	gene.dolgin@…	nobody	"In any given app, creating a directory called 'tests' with an __init__.py file and a number of test_*.py files which contain TestCases, the testrunner errors when trying to load the 'tests' directory

{{{
Traceback (most recent call last):
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_manage.py"", line 127, in <module>
    utility.execute()
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_manage.py"", line 102, in execute
    PycharmTestCommand().run_from_argv(self.argv)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/core/management/commands/test.py"", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/core/management/base.py"", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/core/management/commands/test.py"", line 71, in execute
    super(Command, self).execute(*args, **options)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/core/management/base.py"", line 337, in execute
    output = self.handle(*args, **options)
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_manage.py"", line 89, in handle
    failures = TestRunner(test_labels, verbosity=verbosity, interactive=interactive, failfast=failfast)
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_runner.py"", line 228, in run_tests
    extra_tests=extra_tests, **options)
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_runner.py"", line 128, in run_tests
    return super(DjangoTeamcityTestRunner, self).run_tests(test_labels, extra_tests, **kwargs)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/test/runner.py"", line 146, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File ""/Applications/PyCharm.app/helpers/pycharm/django_test_runner.py"", line 92, in build_suite
    suite = super(DjangoTeamcityTestRunner, self).build_suite(*args, **kwargs)
  File ""/Users/gene/Python/venvs/dd_django/lib/python2.7/site-packages/django/test/runner.py"", line 95, in build_suite
    tests = self.test_loader.discover(start_dir=label, **kwargs)
  File ""/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"", line 204, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File ""/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"", line 265, in _find_tests
    raise ImportError(msg % (mod_name, module_dir, expected_dir))
ImportError: 'tests' module incorrectly imported from '/Users/gene/Python/dd_django/pacer/tests'. Expected '/Users/gene/Python/dd_django/pacer'. Is this module globally installed?
}}}"	Bug	closed	Testing framework	1.7-rc-1	Normal	invalid	testrunner, tests, test	mmitar@…	Unreviewed	0	0	0	0	0	0
