Enable PyTest ruff checks
This commit is contained in:
parent
4655300910
commit
d7d1f42b2c
11 changed files with 42 additions and 37 deletions
|
|
@ -3,14 +3,14 @@
|
|||
from fastapi.testclient import TestClient
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
from pytest import fixture
|
||||
import pytest
|
||||
|
||||
import labthings_fastapi as lt
|
||||
|
||||
from openflexure_microscope_server.things.camera.picamera import StreamingPiCamera2
|
||||
|
||||
|
||||
@fixture(scope="module")
|
||||
@pytest.fixture(scope="module")
|
||||
def client() -> lt.ThingClient:
|
||||
"""Initialise a test client for the StreamingPiCamera2 Thing.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from openflexure_microscope_server.things.camera.picamera import (
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.fixture
|
||||
def picamera_thing() -> StreamingPiCamera2:
|
||||
"""Return a StreamingPiCamera2 Thing.
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ def picamera_thing() -> StreamingPiCamera2:
|
|||
return StreamingPiCamera2()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.fixture
|
||||
def client(picamera_thing) -> lt.ThingClient:
|
||||
"""Initialise a test client for the StreamingPiCamera2 Thing.
|
||||
|
||||
|
|
|
|||
|
|
@ -68,9 +68,6 @@ def _test_bad_tuning_after_good_tuning(configure: bool = False):
|
|||
with pytest.raises(IndexError):
|
||||
# The bad version should cause a problem
|
||||
cam = Picamera2(tuning=bad_tuning)
|
||||
print_tuning()
|
||||
print("Success (not expected)!")
|
||||
del cam
|
||||
recalibrate_utils.recreate_camera_manager()
|
||||
with Picamera2(tuning=default_tuning) as cam:
|
||||
# Reload the camera with working tuning, or it will stop responding
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue