~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/testing/nose.py

  • Committer: Aurélien Bompard
  • Date: 2013-10-22 13:28:11 UTC
  • mfrom: (7215.2.10 3.0)
  • Revision ID: aurelien@bompard.org-20131022132811-d1utj61rqjm178k9
Merge from the main branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    def __init__(self):
48
48
        super(NosePlugin, self).__init__()
49
49
        self.patterns = []
 
50
        self.stderr = False
 
51
        def set_stderr(ignore):
 
52
            self.stderr = True
50
53
        self.addArgument(self.patterns, 'P', 'pattern',
51
54
                         'Add a test matching pattern')
 
55
        self.addFlag(set_stderr, 'E', 'stderr',
 
56
                     'Enable stderr logging to sub-runners')
52
57
 
53
58
    def startTestRun(self, event):
54
59
        MockAndMonkeyLayer.testing_mode = True
55
 
        ConfigLayer.enable_stderr()
 
60
        if (    self.stderr or
 
61
                len(os.environ.get('MM_VERBOSE_TESTLOG', '').strip()) > 0):
 
62
            ConfigLayer.stderr = True
56
63
 
57
64
    def getTestCaseNames(self, event):
58
65
        if len(self.patterns) == 0: