Skip to content

Commit cdcc720

Browse files
committed
wip: really, no sysmon warnings
1 parent 1192387 commit cdcc720

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ filterwarnings = [
128128

129129
## Pytest warns if it can't collect things that seem to be tests. This should be an error.
130130
"error::pytest.PytestCollectionWarning",
131+
132+
"ignore:.*no-sysmon"
131133
]
132134

133135
# xfail tests that pass should fail the test suite

tests/conftest.py

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def reset_filesdotpy_globals() -> Iterator[None]:
9090

9191
def pytest_sessionstart() -> None:
9292
"""Run once at the start of the test session."""
93+
warnings.filterwarnings("ignore", r".*no-sysmon")
9394
# Only in the main process...
9495
if WORKER == "none":
9596
# Create a .pth file for measuring subprocess coverage.
@@ -99,6 +100,7 @@ def pytest_sessionstart() -> None:
99100
# subcover.pth is deleted by pytest_sessionfinish below.
100101

101102

103+
102104
def pytest_sessionfinish() -> None:
103105
"""Hook the end of a test session, to clean up."""
104106
# This is called by each of the workers and by the main process.

tests/helpers.py

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ def run_command(cmd: str) -> tuple[int, str]:
5252
sub_env = dict(os.environ)
5353
sub_env['PYTHONIOENCODING'] = encoding
5454

55+
# We might have COVERAGE_PROCESS_START set for metacov, but don't want that
56+
# affecting commands we run in tests.
57+
proc_start = sub_env.get("COVERAGE_PROCESS_START")
58+
if proc_start and "metacov.ini" in proc_start:
59+
del sub_env["COVERAGE_PROCESS_START"]
60+
5561
proc = subprocess.Popen(
5662
cmd,
5763
shell=True,

0 commit comments

Comments
 (0)