[New-bugs-announce] [issue24055] unittest package-level set up & tear down module

Demian Brecht report at bugs.python.org
Fri Apr 24 22:25:56 CEST 2015

New submission from Demian Brecht:

There's a feature available via nose that might be nice to have in unittest: package-level setup and teardown functions.

Using nose, I can define a setUpModule() method in a test package's __init__.py and it will execute it during the test run. This is helpful for test packages that test related features and may have expensive setup/teardown routines. By having the test runner pick up setup/teardown methods in __init__.py, I can now incur this expense once rather than once per module.

I don't mind putting a patch together for this if others think this might be beneficial.

components: Library (Lib)
messages: 241981
nosy: demian.brecht, ezio.melotti, michael.foord, rbcollins
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest package-level set up & tear down module
type: enhancement
versions: Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list