Skip to content

Commit 139997a

Browse files
committed
Restore the suppress_path_mangle test fixture
1 parent ea273dd commit 139997a

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,23 @@ def disable_macos_customization(monkeypatch):
66
from compilers.common.platform import macos
77

88
monkeypatch.setattr(macos, 'customize_compiler', lambda config_vars: None)
9+
10+
11+
# from pytest-dev/pytest#363
12+
@pytest.fixture(scope="session")
13+
def monkeysession():
14+
from _pytest.monkeypatch import MonkeyPatch
15+
16+
mpatch = MonkeyPatch()
17+
yield mpatch
18+
mpatch.undo()
19+
20+
21+
@pytest.fixture(scope="module")
22+
def suppress_path_mangle(monkeysession):
23+
"""
24+
Disable the path mangling in the compiler. Workaround for pypa/distutils#169.
25+
"""
26+
from compilers.C import base
27+
28+
monkeysession.setattr(base.Compiler, '_make_relative', staticmethod(lambda x: x))

0 commit comments

Comments
 (0)