@@ -1882,6 +1882,7 @@ def hook(
1882
1882
if PathFinder.find_spec has been called.
1883
1883
"""
1884
1884
import importlib .machinery
1885
+
1885
1886
self .find_spec_calls : list [str ] = []
1886
1887
self .initial_paths : set [Path ] = set ()
1887
1888
@@ -1955,7 +1956,6 @@ def test_simple_failure():
1955
1956
assert hook .find_spec ("file" ) is not None
1956
1957
assert self .find_spec_calls == ["file" ]
1957
1958
1958
-
1959
1959
def test_assert_rewrites_only_rootpath (
1960
1960
self , pytester : Pytester , hook : AssertionRewritingHook , monkeypatch
1961
1961
) -> None :
@@ -1975,12 +1975,11 @@ def test_simple_failure():
1975
1975
1976
1976
rootpath = f"{ os .getcwd ()} /tests"
1977
1977
if not os .path .exists (rootpath ):
1978
- mkdir (rootpath )
1978
+ mkdir (rootpath )
1979
1979
monkeypatch .chdir (rootpath )
1980
1980
with mock .patch .object (hook , "fnpats" , ["*.py" ]):
1981
1981
assert hook .find_spec ("file" ) is None
1982
1982
1983
-
1984
1983
def test_assert_correct_for_conftfest (
1985
1984
self , pytester : Pytester , hook : AssertionRewritingHook , monkeypatch
1986
1985
) -> None :
@@ -1997,12 +1996,11 @@ def fix(): return 1
1997
1996
1998
1997
rootpath = f"{ os .getcwd ()} /tests"
1999
1998
if not os .path .exists (rootpath ):
2000
- mkdir (rootpath )
1999
+ mkdir (rootpath )
2001
2000
monkeypatch .chdir (rootpath )
2002
2001
2003
2002
with mock .patch .object (hook , "fnpats" , ["*.py" ]):
2004
2003
assert hook .find_spec ("conftest" ) is not None
2005
-
2006
2004
2007
2005
def test_assert_excluded_rewrite_for_plugins (
2008
2006
self , pytester : Pytester , hook : AssertionRewritingHook , monkeypatch
@@ -2025,7 +2023,6 @@ def test_assert_excluded_rewrite_for_plugins(
2025
2023
with mock .patch .object (hook , "fnpats" , ["*.py" ]):
2026
2024
assert hook .find_spec ("plugin" ) is not None
2027
2025
2028
-
2029
2026
@pytest .mark .skipif (
2030
2027
sys .platform .startswith ("win32" ), reason = "cannot remove cwd on Windows"
2031
2028
)
0 commit comments