Skip to content

Commit 194873d

Browse files
authored
Fixed a teststubtest test failing in python 3.10 (#10406)
1 parent 44925f4 commit 194873d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mypy/test/teststubtest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import tempfile
88
import textwrap
99
import unittest
10+
from pathlib import Path
1011
from typing import Any, Callable, Iterator, List, Optional
1112

1213
import mypy.stubtest
@@ -83,7 +84,9 @@ def run_stubtest(
8384
use_builtins_fixtures=True
8485
)
8586

86-
return output.getvalue()
87+
module_path = Path(os.getcwd()) / TEST_MODULE_NAME
88+
# remove cwd as it's not available from outside
89+
return output.getvalue().replace(str(module_path), TEST_MODULE_NAME)
8790

8891

8992
class Case:

0 commit comments

Comments
 (0)