Skip to content

Commit e54277f

Browse files
committed
Compare types in test_orig_head with "is"
This performs an exact type comparison with "is" instead of "==". Most (maybe all?) of the rest of the places where "==" was used have been changed previously, but this on fell through the cracks. Like the None object, type objects use reference-based equality comparison, and the idiomatic ways to check against them are "is" for exactly comparisons and isinstance/issubclass otherwise.
1 parent 86fcb1b commit e54277f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_refs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_is_valid(self):
207207
assert not SymbolicReference(self.rorepo, "hellothere").is_valid()
208208

209209
def test_orig_head(self):
210-
assert type(self.rorepo.head.orig_head()) == SymbolicReference
210+
assert type(self.rorepo.head.orig_head()) is SymbolicReference
211211

212212
@with_rw_repo("0.1.6")
213213
def test_head_checkout_detached_head(self, rw_repo):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy