Skip to content

Commit

Permalink
fixup! Add skip
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Jun 26, 2023
1 parent b8755ba commit dae5921
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_modutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import astroid
from astroid import modutils
from astroid.const import PY310_PLUS, WIN32
from astroid.const import PY310_PLUS, PY311_PLUS, WIN32
from astroid.interpreter._import import spec

from . import resources
Expand Down Expand Up @@ -268,12 +268,14 @@ def test_std_lib(self) -> None:
os.path.realpath(os.path.__file__.replace(".pyc", ".py")),
)

@pytest.mark.skipif(
WIN32 and not PY311_PLUS,
reason="Fails on Windows below 3.11 for what seems like a test setup/isolation issue "
"rather than a functional issue. Possibly related: "
"https://github.com/python/cpython/pull/93653 (other surrounding tests add '.' to sys.path)",
)
def test_std_lib_found_before_same_named_package_on_path(self) -> None:
realpath = str(resources.RESOURCE_PATH)
if WIN32:
# Escape backslashes.
realpath = realpath.replace("\\", "\\\\")
sys.path.insert(0, realpath)
sys.path.insert(0, str(resources.RESOURCE_PATH))
self.addCleanup(sys.path.pop, 0)

file = modutils.file_from_modpath(["copy"])
Expand Down

0 comments on commit dae5921

Please sign in to comment.