setup: Add tests --regenerate-output

Static variable is too dangerous (notice I forgot to unset it with a
recent commit)
This commit is contained in:
Cole Robinson 2014-02-03 15:53:54 -05:00
parent cac593da8f
commit 35d06e668a
2 changed files with 5 additions and 2 deletions

View File

@ -373,12 +373,14 @@ class TestBaseCommand(Command):
user_options = [
('debug', 'd', 'Show debug output'),
('coverage', 'c', 'Show coverage report'),
('regenerate-output', None, 'Regenerate test output'),
("only=", None,
"Run only testcases whose name contains the passed string"),
]
def initialize_options(self):
self.debug = 0
self.regenerate_output = 0
self.coverage = 0
self.only = None
self._testfiles = []
@ -404,6 +406,7 @@ class TestBaseCommand(Command):
import tests as testsmodule
testsmodule.cov = cov
testsmodule.utils.REGENERATE_OUTPUT = bool(self.regenerate_output)
if hasattr(unittest, "installHandler"):
try:

View File

@ -28,8 +28,8 @@ from virtinst import VirtualDisk
from virtinst import VirtualGraphics
from virtinst import VirtualVideoDevice
# Enable this to refresh test output
REGENERATE_OUTPUT = True
# DON'T EDIT THIS. Use 'setup.py test --regenerate-output'
REGENERATE_OUTPUT = False
# pylint: disable=W0212
# Access to protected member, needed to unittest stuff