@@ -183,21 +183,17 @@ def cant_trace_msg(concurrency: str, the_module: ModuleType | None) -> str | Non
183183concurrency = "," .join (parts )
184184
185185if testenv .SYS_MON and concurrency :
186- expected_out = (
187- f"Can't use core=sysmon: sys.monitoring doesn't support concurrency={ concurrency } \n "
188- )
186+ expected_out = f"Can't use core=sysmon: it doesn't support concurrency={ concurrency } ;"
189187elif the_module is None :
190188# We don't even have the underlying module installed, we expect
191189# coverage to alert us to this fact.
192- expected_out = (
193- f"Couldn't trace with concurrency={ concurrency } , the module isn't installed.\n "
194- )
190+ expected_out = f"Couldn't trace with concurrency={ concurrency } , the module isn't installed."
195191elif testenv .C_TRACER or concurrency == "thread" or concurrency == "" :
196192expected_out = None
197193else :
198194expected_out = (
199195f"Can't support concurrency={ concurrency } with{ testenv .REQUESTED_TRACER_CLASS } , "
200- + "only threads are supported.\n "
196+ + "only threads are supported."
201197 )
202198return expected_out
203199
@@ -230,7 +226,7 @@ def try_some_code(
230226expected_cant_trace = cant_trace_msg (concurrency ,the_module )
231227
232228if expected_cant_trace is not None :
233- assert out == expected_cant_trace
229+ assert expected_cant_trace in out
234230pytest .skip (f"Can't test:{ expected_cant_trace } " )
235231else :
236232# We can fully measure the code if we are using the C tracer, which
@@ -406,7 +402,7 @@ def test_missing_module(self, module: str) -> None:
406402self .make_file ("prog.py" ,"a = 1" )
407403sys .modules [module ]= None # type: ignore[assignment]
408404if testenv .SYS_MON :
409- msg = rf"Can't use core=sysmon:sys.monitoring doesn't support concurrency={ module } "
405+ msg = rf"Can't use core=sysmon:it doesn't support concurrency={ module } "
410406else :
411407msg = rf"Couldn't trace with concurrency={ module } , the module isn't installed."
412408with pytest .raises (ConfigError ,match = msg ):
@@ -501,8 +497,7 @@ def try_multiprocessing_code(
501497expected_cant_trace = cant_trace_msg (concurrency ,the_module )
502498
503499if expected_cant_trace is not None :
504- print (out )
505- assert out == expected_cant_trace
500+ assert expected_cant_trace in out
506501pytest .skip (f"Can't test:{ expected_cant_trace } " )
507502else :
508503assert out .rstrip ()== expected_out
@@ -579,9 +574,6 @@ def test_multiprocessing_with_branching(self, start_method: str) -> None:
579574code = (SQUARE_OR_CUBE_WORK + MULTI_CODE ).format (NPROCS = nprocs ,UPTO = upto )
580575total = sum (x * x if x % 2 else x * x * x for x in range (upto ))
581576expected_out = f"{ nprocs } pids, total ={ total } "
582- expect_warn = (
583- env .PYBEHAVIOR .pep669 and (not env .PYBEHAVIOR .branch_right_left )and testenv .SYS_MON
584- )
585577self .make_file ("multi.py" ,code )
586578self .make_file (
587579"multi.rc" ,
@@ -590,8 +582,7 @@ def test_multiprocessing_with_branching(self, start_method: str) -> None:
590582 concurrency = multiprocessing
591583 branch = True
592584 omit = */site-packages/*
593- """
594- + ("disable_warnings = no-sysmon" if expect_warn else "" ),
585+ """ ,
595586 )
596587
597588out = self .run_command (f"coverage run --rcfile=multi.rc multi.py{ start_method } " )