Skip to content

Commit 03814ed

Browse files
committed
Try jaraco.path.DirectoryStack().context
1 parent 7b77311 commit 03814ed

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

setuptools/tests/config/test_pyprojecttoml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import re
22
from configparser import ConfigParser
33
from inspect import cleandoc
4-
from pathlib import Path
54

65
import jaraco.path
76
import pytest
@@ -363,7 +362,7 @@ def test_include_package_data_in_setuppy(tmp_path):
363362
}
364363
jaraco.path.build(files, prefix=tmp_path)
365364

366-
with Path(tmp_path):
365+
with jaraco.path.DirectoryStack().context(tmp_path):
367366
dist = distutils.core.run_setup("setup.py", {}, stop_after="config")
368367

369368
assert dist.get_name() == "myproj"

setuptools/tests/test_config_discovery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def _get_dist(dist_path, attrs):
618618

619619
script = dist_path / 'setup.py'
620620
if script.exists():
621-
with Path(dist_path):
621+
with jaraco.path.DirectoryStack().context(dist_path):
622622
dist = cast(
623623
Distribution,
624624
distutils.core.run_setup("setup.py", {}, stop_after="init"),
@@ -628,7 +628,7 @@ def _get_dist(dist_path, attrs):
628628

629629
dist.src_root = root
630630
dist.script_name = "setup.py"
631-
with Path(dist_path):
631+
with jaraco.path.DirectoryStack().context(dist_path):
632632
dist.parse_config_files()
633633

634634
dist.set_defaults()

setuptools/tests/test_editable_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ class TestLinkTree:
973973
def test_generated_tree(self, tmp_path):
974974
jaraco.path.build(self.FILES, prefix=tmp_path)
975975

976-
with Path(tmp_path):
976+
with jaraco.path.DirectoryStack().context(tmp_path):
977977
name = "mypkg-3.14159"
978978
dist = Distribution({"script_name": "%PEP 517%"})
979979
dist.parse_config_files()

0 commit comments

Comments
 (0)