Commit 4e0ac6d4 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25607: Restore old distutils logging threshold after running tests that

parse command line arguments.
parent 1b3e7be2
......@@ -9,6 +9,7 @@ import test.support
from test.support import captured_stdout, run_unittest
import unittest
from distutils.tests import support
from distutils import log
# setup script that uses __file__
setup_using___file__ = """\
......@@ -36,6 +37,7 @@ class CoreTestCase(support.EnvironGuard, unittest.TestCase):
self.old_stdout = sys.stdout
self.cleanup_testfn()
self.old_argv = sys.argv, sys.argv[:]
self.addCleanup(log.set_threshold, log._global_log.threshold)
def tearDown(self):
sys.stdout = self.old_stdout
......
......@@ -13,6 +13,7 @@ from distutils.cmd import Command
from test.support import TESTFN, captured_stdout, run_unittest
from distutils.tests import support
from distutils import log
class test_dist(Command):
......@@ -405,6 +406,7 @@ class MetadataTestCase(support.TempdirManager, support.EnvironGuard,
def test_show_help(self):
# smoke test, just makes sure some help is displayed
self.addCleanup(log.set_threshold, log._global_log.threshold)
dist = Distribution()
sys.argv = []
dist.help = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment