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

Diff for: test/test_refs.py

+1-1
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)