Use isinstance in unit tests for type checks (#80906)

pull/80911/head
Matt Clay 2 years ago committed by GitHub
parent 585b82838b
commit 43c31c5dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,7 @@ class DictDataLoader(DataLoader):
def __init__(self, file_mapping=None): def __init__(self, file_mapping=None):
file_mapping = {} if file_mapping is None else file_mapping file_mapping = {} if file_mapping is None else file_mapping
assert type(file_mapping) == dict assert isinstance(file_mapping, dict)
super(DictDataLoader, self).__init__() super(DictDataLoader, self).__init__()

@ -67,4 +67,4 @@ def test_invalid_strings_with_exceptions(am, code, expected, exception):
if exception is None: if exception is None:
assert res[1] == exception assert res[1] == exception
else: else:
assert type(res[1]) == exception assert isinstance(res[1], exception)

Loading…
Cancel
Save