Skip to content

Commit 9939b1f

Browse files
derek73claude
andcommitted
test: use assertIs/assertIsNot shims in existing identity checks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5bbc1ca commit 9939b1f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/test_python_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
dill = False # type: ignore[assignment]
1111

1212
from nameparser import HumanName
13-
from nameparser.config import Constants, TupleManager
13+
from nameparser.config import CONSTANTS, Constants, TupleManager
1414

1515
from tests.base import HumanNameTestBase
1616

@@ -96,7 +96,7 @@ def test_comparison(self) -> None:
9696
hn1 = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
9797
hn2 = HumanName("Dr. John P. Doe-Ray, CLU, CFP, LUTC")
9898
self.assertTrue(hn1 == hn2)
99-
self.assertTrue(hn1 is not hn2)
99+
self.assertIsNot(hn1, hn2)
100100
self.assertTrue(hn1 == "Dr. John P. Doe-Ray CLU, CFP, LUTC")
101101
hn1 = HumanName("Doe, Dr. John P., CLU, CFP, LUTC")
102102
hn2 = HumanName("Dr. John P. Doe-Ray, CLU, CFP, LUTC")
@@ -156,7 +156,7 @@ def test_comparison_case_insensitive(self) -> None:
156156
hn1 = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
157157
hn2 = HumanName("dr. john p. doe-Ray, CLU, CFP, LUTC")
158158
self.assertTrue(hn1 == hn2)
159-
self.assertTrue(hn1 is not hn2)
159+
self.assertIsNot(hn1, hn2)
160160
self.assertTrue(hn1 == "Dr. John P. Doe-ray clu, CFP, LUTC")
161161

162162
def test_slice(self) -> None:
@@ -222,7 +222,7 @@ def test_is_conjunction_with_list(self) -> None:
222222
def test_override_constants(self) -> None:
223223
C = Constants()
224224
hn = HumanName(constants=C)
225-
self.assertTrue(hn.C is C)
225+
self.assertIs(hn.C, C)
226226

227227
def test_override_regex(self) -> None:
228228
var = TupleManager([("spaces", re.compile(r"\s+", re.U)),])

0 commit comments

Comments
 (0)