Skip to content

Commit

Permalink
Update test case for both with and without SysMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored and nedbat committed Feb 10, 2024
1 parent d3e8fab commit b095db2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,15 +1122,17 @@ def test_core_request_pytrace(self) -> None:
core = re_line(r" core:", out).strip()
assert core == "core: PyTracer"

@pytest.mark.skipif(not env.PYBEHAVIOR.pep669, reason="No sys.monitoring to request")
def test_core_request_sysmon(self) -> None:
self.del_environ("COVERAGE_TEST_CORES")
self.set_environ("COVERAGE_CORE", "sysmon")
self.make_file("numbers.py", "print(123, 456)")
out = self.run_command("coverage run --debug=sys numbers.py")
assert out.endswith("123 456\n")
core = re_line(r" core:", out).strip()
assert core == "core: SysMonitor"
if env.PYBEHAVIOR.pep669:
assert core == "core: SysMonitor"
else:
assert core in ("core: CTracer", "core: PyTracer")


class FailUnderNoFilesTest(CoverageTest):
Expand Down

0 comments on commit b095db2

Please sign in to comment.