summaryrefslogtreecommitdiff
path: root/Lib/packaging/tests/test_command_build_py.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/packaging/tests/test_command_build_py.py')
-rw-r--r--Lib/packaging/tests/test_command_build_py.py26
1 files changed, 8 insertions, 18 deletions
diff --git a/Lib/packaging/tests/test_command_build_py.py b/Lib/packaging/tests/test_command_build_py.py
index 4d93faa012..f7f26dafe9 100644
--- a/Lib/packaging/tests/test_command_build_py.py
+++ b/Lib/packaging/tests/test_command_build_py.py
@@ -67,8 +67,6 @@ class BuildPyTestCase(support.TempdirManager,
def test_empty_package_dir(self):
# See SF 1668596/1720897.
- cwd = os.getcwd()
-
# create the distribution files.
sources = self.mkdtemp()
pkg = os.path.join(sources, 'pkg')
@@ -79,24 +77,16 @@ class BuildPyTestCase(support.TempdirManager,
open(os.path.join(testdir, "testfile"), "wb").close()
os.chdir(sources)
- old_stdout = sys.stdout
- #sys.stdout = StringIO.StringIO()
+ dist = Distribution({"packages": ["pkg"],
+ "package_dir": sources,
+ "package_data": {"pkg": ["doc/*"]}})
+ dist.script_args = ["build"]
+ dist.parse_command_line()
try:
- dist = Distribution({"packages": ["pkg"],
- "package_dir": sources,
- "package_data": {"pkg": ["doc/*"]}})
- dist.script_args = ["build"]
- dist.parse_command_line()
-
- try:
- dist.run_commands()
- except PackagingFileError:
- self.fail("failed package_data test when package_dir is ''")
- finally:
- # Restore state.
- os.chdir(cwd)
- sys.stdout = old_stdout
+ dist.run_commands()
+ except PackagingFileError:
+ self.fail("failed package_data test when package_dir is ''")
def test_byte_compile(self):
project_dir, dist = self.create_dist(py_modules=['boiledeggs'])