@@ -32,6 +32,7 @@ def test_no_comparison_on_first_run(self, pytester: pytest.Pytester) -> None:
3232
3333 result = run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
3434
35+ result .assert_outcomes (passed = 1 )
3536 result .stdout .no_fnmatch_line ("*CodSpeed local comparison*" )
3637
3738 def test_comparison_appears_on_second_run (self , pytester : pytest .Pytester ) -> None :
@@ -44,6 +45,7 @@ def test_comparison_appears_on_second_run(self, pytester: pytest.Pytester) -> No
4445 # Second run — finds the first JSON as baseline
4546 result = run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
4647
48+ result .assert_outcomes (passed = 1 )
4749 result .stdout .fnmatch_lines (["*CodSpeed local comparison*" ])
4850
4951 def test_comparison_shows_benchmark_count (self , pytester : pytest .Pytester ) -> None :
@@ -53,33 +55,31 @@ def test_comparison_shows_benchmark_count(self, pytester: pytest.Pytester) -> No
5355 run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
5456 result = run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
5557
56- # "1 compared" is the footer line produced by print_comparison_report
58+ result . assert_outcomes ( passed = 1 )
5759 result .stdout .fnmatch_lines (["*1 compared*" ])
5860
59- def test_no_comparison_with_profile_folder (self , pytester : pytest .Pytester ) -> None :
60- """When --codspeed-profile-folder is set, comparison is skipped.
61+ def test_no_comparison_with_profile_folder (
62+ self , pytester : pytest .Pytester , monkeypatch : pytest .MonkeyPatch
63+ ) -> None :
64+ """When CODSPEED_PROFILE_FOLDER is set, comparison is skipped.
6165
62- The profile folder path is used by the CodSpeed runner in CI; in
66+ The profile folder env var is used by the CodSpeed runner in CI; in
6367 that context the result file is written to a custom location and
6468 the local comparison loop makes no sense.
6569 """
6670 pytester .makepyfile (_BENCH_FILE )
6771 profile_dir = pytester .path / "profile"
6872 profile_dir .mkdir ()
73+ (profile_dir / "results" ).mkdir ()
74+
75+ monkeypatch .setenv ("CODSPEED_PROFILE_FOLDER" , str (profile_dir ))
6976
7077 # First run with profile folder
71- run_pytest_codspeed_with_mode (
72- pytester ,
73- MeasurementMode .WallTime ,
74- f"--codspeed-profile-folder={ profile_dir } " ,
75- )
78+ run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
7679 # Second run with profile folder — still no comparison
77- result = run_pytest_codspeed_with_mode (
78- pytester ,
79- MeasurementMode .WallTime ,
80- f"--codspeed-profile-folder={ profile_dir } " ,
81- )
80+ result = run_pytest_codspeed_with_mode (pytester , MeasurementMode .WallTime )
8281
82+ result .assert_outcomes (passed = 1 )
8383 result .stdout .no_fnmatch_line ("*CodSpeed local comparison*" )
8484
8585 def test_no_comparison_in_simulation_mode (self , pytester : pytest .Pytester ) -> None :
@@ -91,4 +91,5 @@ def test_no_comparison_in_simulation_mode(self, pytester: pytest.Pytester) -> No
9191 # Second run in simulation mode — no benchmarks to compare
9292 result = run_pytest_codspeed_with_mode (pytester , MeasurementMode .Simulation )
9393
94+ result .assert_outcomes (passed = 1 )
9495 result .stdout .no_fnmatch_line ("*CodSpeed local comparison*" )
0 commit comments