mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
improving distutils coverage
This commit is contained in:
parent
6d2db3784a
commit
ccaf380fab
1 changed files with 22 additions and 0 deletions
|
@ -9,6 +9,7 @@ import warnings
|
||||||
|
|
||||||
from distutils.dist import Distribution, fix_help_options
|
from distutils.dist import Distribution, fix_help_options
|
||||||
from distutils.cmd import Command
|
from distutils.cmd import Command
|
||||||
|
import distutils.dist
|
||||||
|
|
||||||
from test.test_support import TESTFN, captured_stdout
|
from test.test_support import TESTFN, captured_stdout
|
||||||
from distutils.tests import support
|
from distutils.tests import support
|
||||||
|
@ -56,6 +57,27 @@ class DistributionTestCase(support.TempdirManager,
|
||||||
d.parse_command_line()
|
d.parse_command_line()
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
def test_debug_mode(self):
|
||||||
|
with open(TESTFN, "w") as f:
|
||||||
|
f.write("[global]")
|
||||||
|
f.write("command_packages = foo.bar, splat")
|
||||||
|
|
||||||
|
files = [TESTFN]
|
||||||
|
sys.argv.append("build")
|
||||||
|
|
||||||
|
with captured_stdout() as stdout:
|
||||||
|
self.create_distribution(files)
|
||||||
|
stdout.seek(0)
|
||||||
|
self.assertEquals(stdout.read(), '')
|
||||||
|
distutils.dist.DEBUG = True
|
||||||
|
try:
|
||||||
|
with captured_stdout() as stdout:
|
||||||
|
self.create_distribution(files)
|
||||||
|
stdout.seek(0)
|
||||||
|
self.assertEquals(stdout.read(), '')
|
||||||
|
finally:
|
||||||
|
distutils.dist.DEBUG = False
|
||||||
|
|
||||||
def test_command_packages_unspecified(self):
|
def test_command_packages_unspecified(self):
|
||||||
sys.argv.append("build")
|
sys.argv.append("build")
|
||||||
d = self.create_distribution()
|
d = self.create_distribution()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue