Skip to content

Commit 02f375b

Browse files
Prefer Path object for test setup
1 parent 33d7979 commit 02f375b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/test_modutils.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import astroid
2222
from astroid import modutils
23-
from astroid.const import PY310_PLUS, WIN32
23+
from astroid.const import PY310_PLUS
2424
from astroid.interpreter._import import spec
2525

2626
from . import resources
@@ -269,14 +269,11 @@ def test_std_lib(self) -> None:
269269
)
270270

271271
def test_std_lib_found_before_same_named_package_on_path(self) -> None:
272-
resource = resources.find("data")
273-
sys.path.insert(0, resource)
272+
sys.path.insert(0, resources.RESOURCE_PATH)
274273
self.addCleanup(sys.path.pop, 0)
275-
sys_path = str(sys.path)
276274

277275
file = modutils.file_from_modpath(["copy"])
278-
if WIN32:
279-
raise AssertionError('\n'.join([resource, sys_path, file]))
276+
280277
self.assertNotIn("test", file) # tests/testdata/python3/data/copy.py
281278
self.assertTrue(any(stdlib in file for stdlib in modutils.STD_LIB_DIRS))
282279

0 commit comments

Comments
 (0)