Skip to content

Commit 447bd2c

Browse files
fix stirring in test env; docs
1 parent ed45e96 commit 447bd2c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

core/pioreactor/calibrations/protocols/stirring_dc_based.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
"""
77
import uuid
8+
from contextlib import nullcontext
89
from time import sleep
910
from typing import ClassVar
1011
from typing import Literal
@@ -33,6 +34,10 @@
3334
from pioreactor.utils.timing import current_utc_datetime
3435
from pioreactor.whoami import get_testing_experiment_name
3536
from pioreactor.whoami import get_unit_name
37+
from pioreactor.whoami import is_testing_env
38+
39+
if is_testing_env():
40+
from pioreactor.utils.mock import MockRpmCalculator
3641

3742

3843
def _resolve_dc_bounds(min_dc: float | None, max_dc: float | None) -> tuple[float, float]:
@@ -68,7 +73,10 @@ def collect_stirring_measurements(
6873
dcs = linspace(max_dc, min_dc, 5) + linspace(min_dc, max_dc, 5) + linspace(max_dc, min_dc, 5)
6974
n_samples = len(dcs)
7075

71-
with stirring.RpmFromFrequency() as rpm_calc, stirring.Stirrer(
76+
rpm_calc_context = (
77+
nullcontext(MockRpmCalculator()) if is_testing_env() else stirring.RpmFromFrequency()
78+
)
79+
with rpm_calc_context as rpm_calc, stirring.Stirrer(
7280
target_rpm=0,
7381
unit=unit,
7482
experiment=experiment,

core/tests/test_calibrations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def test_load_calibration_validation_error(temp_calibration_dir) -> None:
101101
load_calibration("od90", "bad_cal")
102102

103103
assert "Error reading bad_cal" in str(exc_info.value)
104+
bad_calibration_file.unlink()
104105

105106

106107
# test calibration structs

frontend/src/components/SelfTestDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export default function SelfTestDialog({disabled, experiment, unit, label , self
281281

282282
<ManageDivider/>
283283
<Typography variant="body2" component="p" gutterBottom>
284-
Learn more about self tests and <a rel="noopener noreferrer" target="_blank" href="https://docs.pioreactor.com/user-guide/running-self-test#explanation-of-each-test">what to do if a test fails.</a>
284+
Learn more about self tests and <a rel="noopener noreferrer" target="_blank" href="https://docs.pioreactor.com/user-guide/self-test-reference">what to do if a test fails.</a>
285285
</Typography>
286286
</DialogContent>
287287
</Dialog>

0 commit comments

Comments
 (0)