﻿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
26570	Test runner imports models package with Python 3.5+	Torsten Bronger	nobody	"Since Python 3.5, unittest's runner searches for tests also in all `__init__.py` modules.  The release notes say:

    Found packages are now checked for load_tests regardless of
    whether their path matches pattern, because it is impossible for
    a package name to match the default pattern.

If you organise your models in a package rather than a single `models.py` (the `__init__.py` file contains commands like `from submodule import *` to collect all model classes in the package), this leads to an error in a bogus test saying that the app is not ready yet.  This happens because the model classes are executed, and this occurs too early (it should not occur at all).

A workaround is to say

{{{
manage.py test myapp/tests
}}}

instead of

{{{
manage.py test myapp
}}}

if your tests live in `tests/` and only there.
"	Bug	closed	Testing framework	1.9	Normal	needsinfo		bronger@…	Unreviewed	0	0	0	0	0	0
