Skip to content

Commit f9881af

Browse files
committed
fix(testing): pytest.approx returns a clearer error mesage when comparing mappings with different keys
1 parent 64e3c91 commit f9881af

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

testing/python/approx.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
# mypy: allow-untyped-defs
22
from __future__ import annotations
33

4-
from contextlib import contextmanager
54
import decimal
6-
from decimal import Decimal
7-
from fractions import Fraction
8-
from math import inf
9-
from math import nan
10-
from math import sqrt
115
import operator
12-
from operator import eq
13-
from operator import ne
146
import re
7+
from contextlib import contextmanager
8+
from decimal import Decimal
9+
from fractions import Fraction
10+
from math import inf, nan, sqrt
11+
from operator import eq, ne
1512

13+
import pytest
1614
from _pytest.pytester import Pytester
1715
from _pytest.python_api import _recursive_sequence_map
18-
import pytest
1916
from pytest import approx
2017

2118

0 commit comments

Comments
 (0)