Skip to content

Commit cab8c67

Browse files
authored
test_parse_data: fix cwd (#15417)
Fixes #15385 (comment)
1 parent 9b9272a commit cab8c67

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/test/meta/test_parse_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ def _dedent(self, s: str) -> str:
1616
return textwrap.dedent(s).lstrip()
1717

1818
def _run_pytest(self, data_suite: str) -> str:
19-
p = Path(test_data_prefix) / "check-__fixture__.test"
19+
p_test_data = Path(test_data_prefix)
20+
p_root = p_test_data.parent.parent
21+
p = p_test_data / "check-__fixture__.test"
2022
assert not p.exists()
2123
try:
2224
p.write_text(data_suite)
2325
test_nodeid = f"mypy/test/testcheck.py::TypeCheckSuite::{p.name}"
2426
args = [sys.executable, "-m", "pytest", "-n", "0", "-s", test_nodeid]
25-
proc = subprocess.run(args, capture_output=True, check=False)
27+
proc = subprocess.run(args, cwd=p_root, capture_output=True, check=False)
2628
return proc.stdout.decode()
2729
finally:
2830
p.unlink()

0 commit comments

Comments
 (0)