@@ -283,7 +283,7 @@ def f1() -> None: # pragma: nested
283283 def run_one_function (f : Callable [[], None ]) -> None :
284284 cov .erase ()
285285 cov .start ()
286- f ()
286+ f () # pragma: nested
287287 cov .stop ()
288288
289289 fs = cov .get_data ().measured_files ()
@@ -367,7 +367,7 @@ def test_start_save_stop(self) -> None:
367367 import_local_file ("code1" ) # pragma: nested
368368 cov .save () # pragma: nested
369369 import_local_file ("code2" ) # pragma: nested
370- cov .stop () # pragma: nested
370+ cov .stop ()
371371 self .check_code1_code2 (cov )
372372
373373 def test_start_save_nostop (self ) -> None :
@@ -379,14 +379,14 @@ def test_start_save_nostop(self) -> None:
379379 import_local_file ("code2" ) # pragma: nested
380380 self .check_code1_code2 (cov ) # pragma: nested
381381 # Then stop it, or the test suite gets out of whack.
382- cov .stop () # pragma: nested
382+ cov .stop ()
383383
384384 def test_two_getdata_only_warn_once (self ) -> None :
385385 self .make_code1_code2 ()
386386 cov = coverage .Coverage (source = ["." ], omit = ["code1.py" ])
387387 cov .start ()
388388 import_local_file ("code1" ) # pragma: nested
389- cov .stop () # pragma: nested
389+ cov .stop ()
390390 # We didn't collect any data, so we should get a warning.
391391 with self .assert_warnings (cov , ["No data was collected" ]):
392392 cov .get_data ()
@@ -408,7 +408,7 @@ def test_two_getdata_warn_twice(self) -> None:
408408 with self .assert_warnings (cov , ["No data was collected" ]): # pragma: nested
409409 cov .get_data () # pragma: nested
410410 # Then stop it, or the test suite gets out of whack.
411- cov .stop () # pragma: nested
411+ cov .stop ()
412412
413413 def make_good_data_files (self ) -> None :
414414 """Make some good data files."""
@@ -705,11 +705,11 @@ def test_dynamic_context_conflict(self) -> None:
705705 cov = coverage .Coverage (source = ["." ])
706706 cov .set_option ("run:dynamic_context" , "test_function" )
707707 cov .start ()
708- with pytest .warns (Warning ) as warns :
708+ with pytest .warns (Warning ) as warns : # pragma: nested
709709 # Switch twice, but only get one warning.
710- cov .switch_context ("test1" ) # pragma: nested
711- cov .switch_context ("test2" ) # pragma: nested
712- cov .stop () # pragma: nested
710+ cov .switch_context ("test1" )
711+ cov .switch_context ("test2" )
712+ cov .stop ()
713713 assert_coverage_warnings (warns , "Conflicting dynamic contexts (dynamic-conflict)" )
714714
715715 def test_unknown_dynamic_context (self ) -> None :
@@ -728,7 +728,7 @@ def test_switch_context_unstarted(self) -> None:
728728 cov .start ()
729729 cov .switch_context ("test2" ) # pragma: nested
730730
731- cov .stop () # pragma: nested
731+ cov .stop ()
732732 with pytest .raises (CoverageException , match = msg ):
733733 cov .switch_context ("test3" )
734734
@@ -752,7 +752,7 @@ def test_run_debug_sys(self) -> None:
752752 cov = coverage .Coverage ()
753753 cov .start ()
754754 d = dict (cov .sys_info ()) # pragma: nested
755- cov .stop () # pragma: nested
755+ cov .stop ()
756756 assert cast (str , d ['data_file' ]).endswith (".coverage" )
757757
758758
@@ -902,7 +902,7 @@ def coverage_usepkgs_counts(self, **kwargs: TCovKwargs) -> Dict[str, int]:
902902 cov = coverage .Coverage (** kwargs )
903903 cov .start ()
904904 import usepkgs # pragma: nested # pylint: disable=import-error, unused-import
905- cov .stop () # pragma: nested
905+ cov .stop ()
906906 with self .assert_warnings (cov , []):
907907 data = cov .get_data ()
908908 summary = line_counts (data )
@@ -919,7 +919,7 @@ def test_source_include_exclusive(self) -> None:
919919 cov = coverage .Coverage (source = ["pkg1" ], include = ["pkg2" ])
920920 with self .assert_warnings (cov , ["--include is ignored because --source is set" ]):
921921 cov .start ()
922- cov .stop () # pragma: nested
922+ cov .stop ()
923923
924924 def test_source_package_as_package (self ) -> None :
925925 assert not os .path .isdir ("pkg1" )
@@ -995,7 +995,7 @@ def coverage_usepkgs(self, **kwargs: TCovKwargs) -> Iterable[str]:
995995 cov = coverage .Coverage ()
996996 cov .start ()
997997 import usepkgs # pragma: nested # pylint: disable=import-error, unused-import
998- cov .stop () # pragma: nested
998+ cov .stop ()
999999 report = io .StringIO ()
10001000 cov .report (file = report , ** kwargs )
10011001 return report .getvalue ()
@@ -1014,7 +1014,7 @@ def coverage_usepkgs(self, **kwargs: TCovKwargs) -> Iterable[str]:
10141014 cov = coverage .Coverage ()
10151015 cov .start ()
10161016 import usepkgs # pragma: nested # pylint: disable=import-error, unused-import
1017- cov .stop () # pragma: nested
1017+ cov .stop ()
10181018 cov .xml_report (outfile = "-" , ** kwargs )
10191019 return self .stdout ()
10201020
0 commit comments