Skip to content

Commit 4620013

Browse files
author
finlayclark
committed
More tests on printing
1 parent b1547c7 commit 4620013

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

k2dg/_print.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ def _print_kd0(kd0: Quantity) -> None:
2424
return
2525
# The value is less than 0.1 pM or greater than 100 M
2626
if kd < 1e-10:
27-
print(f"{kd / 1e-12:#.3g} fM")
27+
print(f"{kd / 1e-15:#.3g} fM")
2828
else:
2929
print(f"{kd:#.3g} M")

tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from io import StringIO
2-
from unittest.mock import patch, Mock
2+
from unittest.mock import patch
33
from k2dg._cli import run_cli # Replace 'your_module' with the actual module name
44

55

tests/test_print.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def test_print_kd0(capsys):
2525
captured = capsys.readouterr()
2626
assert captured.out == "10.0 mM\n"
2727

28-
_print_kd0(Q_(1e2, "M"))
28+
_print_kd0(Q_(1e4, "M"))
2929
captured = capsys.readouterr()
30-
assert captured.out == "100. M\n"
30+
assert captured.out == "1.00e+04 M\n"
31+
32+
_print_kd0(Q_(1e-16, "M"))
33+
captured = capsys.readouterr()
34+
assert captured.out == "0.100 fM\n"

0 commit comments

Comments
 (0)