New submission from the mulhern:

You can run "python -m unittest discover <some args>" and the unittests 
discovered by discover will be run. This is nice.

However, it is actually desirable to run each unittest package individually, 
rather than in the same interpreter instance. When run via discover, imports 
from previous unittests corrupt the namespace of subsequent unittests and lead 
to failures (usually if there are mock objects in previously imported unit 
tests) and successes (usually if some other test module has imported something 
that the current test module ought to import but does not) which are both 
erroneous.

discover should have some option to start the interpreter afresh for each 
unittest package or perhaps just clear all its imports.

----------
components: Library (Lib)
messages: 215380
nosy: the.mulhern
priority: normal
severity: normal
status: open
title: unittest discover should allow option to run each package separately
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21133>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to