@@ -350,12 +350,12 @@ def test_idle_fraction_is_time_weighted_and_bounded(jittery_episode: hflow.Episo
350350 idle = asyncio .run (idle_fraction (jittery_episode , velocity_epsilon = 1e9 , min_interval_s = 0.5 ))
351351 moving_fraction = moving .measurements ["/joint_states/idle_fraction" ]
352352 idle_fraction_value = idle .measurements ["/joint_states/idle_fraction" ]
353- assert isinstance (moving_fraction , float ) and isinstance (idle_fraction_value , float )
353+ assert isinstance (moving_fraction , float )
354+ assert isinstance (idle_fraction_value , float )
354355 assert moving_fraction < 0.05
355356 assert idle_fraction_value == pytest .approx (1.0 )
356- assert idle .intervals and all (
357- interval .label == "idle:/joint_states" for interval in idle .intervals
358- )
357+ assert idle .intervals
358+ assert all (interval .label == "idle:/joint_states" for interval in idle .intervals )
359359 assert moving .verdict is None # evidence, not verdicts
360360
361361
@@ -366,7 +366,8 @@ def test_episode_duration_matches_the_synthesized_span(jittery_episode: hflow.Ep
366366 # The 4 s spec spans ~4 s of log time (one sample period short per stream).
367367 assert duration_s == pytest .approx (4.0 , abs = 0.1 )
368368 message_count_total = result .measurements ["message_count_total" ]
369- assert isinstance (message_count_total , int ) and message_count_total > 0
369+ assert isinstance (message_count_total , int )
370+ assert message_count_total > 0
370371
371372
372373@pytest .fixture
@@ -756,7 +757,8 @@ def test_camera_frame_stats_sees_the_injected_black_segment(tmp_path: Path) -> N
756757 # Which binary measured this: a pinned-build bump moves readings without
757758 # moving the check's version, so the instrument names itself in the row.
758759 instrument = result .measurements ["camera_instrument" ]
759- assert isinstance (instrument , str ) and "ffmpeg version" in instrument
760+ assert isinstance (instrument , str )
761+ assert "ffmpeg version" in instrument
760762
761763
762764def test_camera_frame_stats_handles_duplicate_and_stationary_timestamps_without_zero_division (
@@ -864,7 +866,8 @@ def test_media_digest_matches_the_same_footage_under_different_telemetry(
864866
865867 assert first_media == second_media , "same footage must digest the same"
866868 assert first_content != second_content , "differing telemetry must change content_digest"
867- assert isinstance (media_bytes , int ) and media_bytes > 0
869+ assert isinstance (media_bytes , int )
870+ assert media_bytes > 0
868871
869872
870873def test_media_digest_separates_different_footage (tmp_path : Path ) -> None :
@@ -899,7 +902,8 @@ def test_keyframe_interval_reports_the_encoders_gop(tmp_path: Path) -> None:
899902 result = asyncio .run (keyframe_interval (episode ))
900903
901904 keyframe_count = result .measurements [f"{ camera_topic } /keyframe_count" ]
902- assert isinstance (keyframe_count , int ) and keyframe_count >= 2
905+ assert isinstance (keyframe_count , int )
906+ assert keyframe_count >= 2
903907 assert result .measurements [f"{ camera_topic } /first_frame_is_keyframe" ] == 1
904908 max_gap_s = result .measurements [f"{ camera_topic } /max_keyframe_gap_s" ]
905909 assert isinstance (max_gap_s , float )
@@ -1151,14 +1155,16 @@ def test_camera_signal_quality_measures_range_exposure_and_stillness(tmp_path: P
11511155 luma_min = result .measurements [f"{ camera_topic } /luma_min" ]
11521156 luma_max = result .measurements [f"{ camera_topic } /luma_max" ]
11531157 assert full_range in (0 , 1 )
1154- assert isinstance (luma_min , float ) and isinstance (luma_max , float )
1158+ assert isinstance (luma_min , float )
1159+ assert isinstance (luma_max , float )
11551160 assert 0.0 <= luma_min <= luma_max <= 255.0
11561161 # The verdict must be consistent with its own evidence.
11571162 assert bool (full_range ) == (luma_min < 16.0 or luma_max > 235.0 )
11581163
11591164 # The test pattern moves, so stillness is well above zero.
11601165 frame_difference_mean = result .measurements [f"{ camera_topic } /frame_difference_mean" ]
1161- assert isinstance (frame_difference_mean , float ) and frame_difference_mean > 0.0
1166+ assert isinstance (frame_difference_mean , float )
1167+ assert frame_difference_mean > 0.0
11621168
11631169 # A clean synthetic encode carries no impulse noise.
11641170 assert result .measurements [f"{ camera_topic } /temporal_outlier_max" ] == pytest .approx (
@@ -1190,15 +1196,18 @@ def test_camera_signal_quality_sees_a_blacked_out_segment(tmp_path: Path) -> Non
11901196 # builds' black frames sit under, so the share is stable across them.
11911197 black_share_max = result .measurements [f"{ camera_topic } /black_pixel_share_max" ]
11921198 black_share_mean = result .measurements [f"{ camera_topic } /black_pixel_share_mean" ]
1193- assert isinstance (black_share_max , float ) and black_share_max > 90.0
1199+ assert isinstance (black_share_max , float )
1200+ assert black_share_max > 90.0
11941201 # 2 s of 4 s blacked out; decode boundaries make the exact count fuzzy.
1195- assert isinstance (black_share_mean , float ) and 25.0 < black_share_mean < 75.0
1202+ assert isinstance (black_share_mean , float )
1203+ assert 25.0 < black_share_mean < 75.0
11961204
11971205 # Half the clip near-black must drag the low percentile far below the high
11981206 # one, whatever scale the decoder put them on.
11991207 luma_p10_mean = result .measurements [f"{ camera_topic } /luma_p10_mean" ]
12001208 luma_p90_mean = result .measurements [f"{ camera_topic } /luma_p90_mean" ]
1201- assert isinstance (luma_p10_mean , float ) and isinstance (luma_p90_mean , float )
1209+ assert isinstance (luma_p10_mean , float )
1210+ assert isinstance (luma_p90_mean , float )
12021211 assert luma_p10_mean < luma_p90_mean / 2.0
12031212
12041213
@@ -1251,7 +1260,9 @@ def test_trajectory_metrics_finds_the_injected_hold(held_joints_episode: Path) -
12511260 assert result .measurements ["/joint_states/scale_source" ] == "raw"
12521261 peak = result .measurements ["/joint_states/peak_velocity" ]
12531262 mean = result .measurements ["/joint_states/mean_velocity" ]
1254- assert isinstance (peak , float ) and isinstance (mean , float ) and peak >= mean > 0.0
1263+ assert isinstance (peak , float )
1264+ assert isinstance (mean , float )
1265+ assert peak >= mean > 0.0
12551266 assert result .verdict is None
12561267
12571268
@@ -1276,7 +1287,8 @@ def test_trajectory_metrics_dimension_scales_are_recorded_and_validated(
12761287 assert scaled .measurements ["/joint_states/scale_source" ] == "user"
12771288 raw_peak = raw .measurements ["/joint_states/peak_velocity" ]
12781289 scaled_peak = scaled .measurements ["/joint_states/peak_velocity" ]
1279- assert isinstance (raw_peak , float ) and isinstance (scaled_peak , float )
1290+ assert isinstance (raw_peak , float )
1291+ assert isinstance (scaled_peak , float )
12801292 # Halving every dimension halves the magnitude over all of them.
12811293 assert scaled_peak == pytest .approx (raw_peak / 2.0 )
12821294
@@ -1319,7 +1331,8 @@ def test_trajectory_segments_flags_the_injected_jump_as_a_change(tmp_path: Path)
13191331 max_change = asyncio .run (trajectory_metrics (episode )).measurements [
13201332 "/joint_states/max_trajectory_change"
13211333 ]
1322- assert isinstance (threshold , float ) and isinstance (max_change , float )
1334+ assert isinstance (threshold , float )
1335+ assert isinstance (max_change , float )
13231336 assert max_change > threshold
13241337
13251338
@@ -1484,9 +1497,11 @@ def test_trajectory_metrics_emits_final_pose_speed_for_low_frequency_stream(
14841497 result = asyncio .run (trajectory_metrics (episode ))
14851498
14861499 speed = result .measurements .get ("/joint_states/final_pose_speed" )
1487- assert isinstance (speed , float ) and speed > 0
1500+ assert isinstance (speed , float )
1501+ assert speed > 0
14881502 ratio = result .measurements .get ("/joint_states/final_pose_unsettled_ratio" )
1489- assert isinstance (ratio , float ) and ratio > 0
1503+ assert isinstance (ratio , float )
1504+ assert ratio > 0
14901505
14911506
14921507def test_trajectory_metrics_time_weights_final_pose_speed_identically_to_mean_velocity (
@@ -1571,7 +1586,8 @@ def test_trajectory_metrics_omits_final_pose_speed_when_final_window_is_unmeasur
15711586 assert "/joint_states/final_pose_speed" not in result .measurements
15721587 assert "/joint_states/final_pose_unsettled_ratio" not in result .measurements
15731588 mean = result .measurements .get ("/joint_states/mean_velocity" )
1574- assert isinstance (mean , float ) and mean > 0
1589+ assert isinstance (mean , float )
1590+ assert mean > 0
15751591
15761592
15771593@pytest .fixture (scope = "module" )
0 commit comments