We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3001a55 commit aa510b9Copy full SHA for aa510b9
src/_pytest/python_api.py
@@ -541,12 +541,11 @@ def __repr__(self) -> str:
541
else:
542
abs_ = self.abs
543
544
+ tol_str = "???"
545
if rel is not None and Decimal("1e-3") <= rel <= Decimal("1e3"):
546
tol_str = f"{rel:.1e}"
547
elif abs_ is not None:
548
tol_str = f"{abs_:.1e}"
- else:
549
- tol_str = "???"
550
551
return f"{self.expected} ± {tol_str}"
552
testing/python/approx.py
@@ -2,6 +2,7 @@
2
from __future__ import annotations
3
4
from contextlib import contextmanager
5
+import decimal
6
from decimal import Decimal
7
from fractions import Fraction
8
from math import sqrt
0 commit comments