1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#!/usr/bin/env python3
"""
Helpers for tests
"""
from pathlib import Path
from functools import wraps
import pytest
import os
# @contextmanager
def compiler_present(*args, **kwds):
"""Execute a given block if the named compiler is present, else skip"""
print(f"compiler_present: args are {args}")
@pytest.fixture
def dry_run():
os.environ["NO_ACT"] = "1"
def chdir_to_test(testdir: str):
"""Get the current folder of the test"""
p = Path(__file__).parent.parent / testdir
pytest.MonkeyPatch.chdir(p)
def make_testdir(dirname: str):
pass
|