lint: ruff-clean testbed (blocking file write to thread, unused vars)

This commit is contained in:
opencode
2026-08-08 04:29:51 +03:00
parent 132eb25c62
commit 4ced623b55
8 changed files with 42 additions and 19 deletions
-1
View File
@@ -15,7 +15,6 @@ from testbed.bridge import (
VISION_WIDTH,
build_bridge,
)
from testbed.room.world import Room
@pytest.fixture
+4 -4
View File
@@ -21,7 +21,7 @@ def test_wall_nearby_is_bright_gray():
room = Room()
room.capsule.yaw_deg = 180.0 # face north wall 1.5m away
px = Raycaster().render(room)[0].load()
r, g, b = px[80, 60]
r, g, _b = px[80, 60]
assert abs(r - g) < 8 and r > 80 # gray wall, little fog at 1.5m
@@ -30,11 +30,11 @@ def test_beacon_glow_visible_when_facing_it():
room.capsule.x, room.capsule.z, room.capsule.yaw_deg = 11.0, 11.0, 45.0
img, _ = Raycaster().render(room)
px = img.load()
r, g, b = px[80, 60]
r, _, b = px[80, 60]
assert b > r # inactive beacon glows cyan
room.beacon.active = True
px = Raycaster().render(room)[0].load()
r, g, b = px[80, 60]
r, _, b = px[80, 60]
assert r > b # active beacon glows warm yellow
@@ -42,7 +42,7 @@ def test_beacon_occluded_by_crate():
room = Room()
# Beacon behind crate_red from spawn: center pixel must not be cyan.
px = Raycaster().render(room)[0].load()
r, g, b = px[80, 60]
_r, _g, b = px[80, 60]
assert b < 90
+2 -2
View File
@@ -4,7 +4,7 @@ import math
import pytest
from testbed.room.world import ROOM_SIZE, Beacon, Box, Room
from testbed.room.world import ROOM_SIZE, Room
def test_spawn_state():
@@ -79,7 +79,7 @@ def test_turn_clamps_pitch():
def test_look_at_beacon():
room = Room()
yaw, pitch = room.look_at_beacon()
yaw, _pitch = room.look_at_beacon()
dx = room.beacon.x - room.capsule.x
dz = room.beacon.z - room.capsule.z
assert yaw == pytest.approx(math.degrees(math.atan2(dx, dz)))