Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20ea96f commit 6ae4667Copy full SHA for 6ae4667
1 file changed
Lib/unittest/test/test_runner.py
@@ -139,6 +139,18 @@ def cleanup2():
139
class Test_TextTestRunner(unittest.TestCase):
140
"""Tests for TextTestRunner."""
141
142
+ def setUp(self):
143
+ # clean the environment from pre-existing PYTHONWARNINGS to make
144
+ # test_warnings results consistent
145
+ self.pythonwarnings = os.environ.get('PYTHONWARNINGS')
146
+ if self.pythonwarnings:
147
+ del os.environ['PYTHONWARNINGS']
148
+
149
+ def tearDown(self):
150
+ # bring back pre-existing PYTHONWARNINGS if present
151
152
+ os.environ['PYTHONWARNINGS'] = self.pythonwarnings
153
154
def test_init(self):
155
runner = unittest.TextTestRunner()
156
self.assertFalse(runner.failfast)
0 commit comments