Starting docstring on the same lines as the quotations

This commit is contained in:
Julian Stirling 2025-07-10 01:04:26 +01:00
parent be6a6ca6fe
commit 35d47fe3ed
28 changed files with 92 additions and 214 deletions

View file

@ -32,8 +32,7 @@ def test_calibration(client):
def test_jpeg_and_array(client):
"""
Check that grabbing a jpeg from the stream results in the same size
"""Check that grabbing a jpeg from the stream results in the same size
image as a array capture or a jpeg capture.
"""
# Grab a jpeg from the stream

View file

@ -1,5 +1,4 @@
"""
Check exposure times do not drift.
"""Check exposure times do not drift.
This can get very tedious. Recommend running pytest with -s option
to monitor progress.
@ -19,8 +18,7 @@ logging.basicConfig(level=logging.DEBUG)
def _test_exposure_time_drift(desired_time):
"""
Capture 10 full resolution images and check that the exposure time remains constant
"""Capture 10 full resolution images and check that the exposure time remains constant
This confirms that automatic exposure time adjustment is fully turned off
"""
@ -64,8 +62,6 @@ def _test_exposure_time_drift(desired_time):
def test_exposure_time_drift():
"""
Performs the exposure time test for a range of exposure time values.
"""
"""Performs the exposure time test for a range of exposure time values."""
for desired_time in [100, 1000, 10000]:
_test_exposure_time_drift(desired_time)

View file

@ -12,9 +12,7 @@ logging.basicConfig(level=logging.DEBUG)
def test_sensor_mode():
"""
Test capturing raw arrays in two different sensor modes
"""
"""Test capturing raw arrays in two different sensor modes"""
cam = StreamingPiCamera2()
server = ThingServer()
server.add_thing(cam, "/camera/")

View file

@ -1,6 +1,4 @@
"""
Tests that check that a tuning file can be reloaded
"""
"""Tests that check that a tuning file can be reloaded"""
import os
@ -16,17 +14,13 @@ MODEL = Picamera2.global_camera_info()[0]["Model"]
def load_default_tuning():
"""
Return the default tuning file for the connected camera.
"""
"""Return the default tuning file for the connected camera."""
fname = f"{MODEL}.json"
return Picamera2.load_tuning_file(fname)
def generate_bad_tuning():
"""
Return a tuning file with an invalid version number to force an error when loaded.
"""
"""Return a tuning file with an invalid version number to force an error when loaded."""
default_tuning = load_default_tuning()
bad_tuning = default_tuning.copy()
bad_tuning["version"] = 999
@ -34,8 +28,7 @@ def generate_bad_tuning():
def print_tuning(read_file: bool = False):
"""
Print the path of the default tuning file from the the environment variable.
"""Print the path of the default tuning file from the the environment variable.
:param read_file: Boolean, set true to also print the file contents.
@ -53,8 +46,7 @@ def print_tuning(read_file: bool = False):
def _test_bad_tuning_after_good_tuning(configure: bool = False):
"""
Load the default tuning file into the camera, re-load with a broken tuning file,
"""Load the default tuning file into the camera, re-load with a broken tuning file,
check it errors. Finally check the default tuning file will load again afterwards.
:param configure: Boolean, set true to configure the camera on initial loading