Skip to content

Commit

Permalink
Use isinstance instead of type() ==
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Aug 28, 2024
1 parent 3026451 commit 3f768be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integration/snmptrapd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_plugin_loader_reading_in_modules_from_config_file():
config.read(configfile)
list_from_config = config.get('snmptrapd', 'handlermodules').split(',')

assert type(list_from_config) == list
assert isinstance(list_from_config, list)
if len(list_from_config) <= 0:
pytest.skip(
"Requires at least one plugin in snmptrapd.conf to run"
Expand Down
3 changes: 1 addition & 2 deletions tests/unittests/netmap/metadata_nx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def _get_metadata(self, node_a, node_b, metadata_key='metadata'):
def test_metadata_contains_edge_objects(self):
for node_a, node_b, metadata in self.netmap_graph.edges(data=True):
for pair in metadata.get('metadata'):
assert type(pair) == Edge
assert type(pair) == Edge
assert isinstance(pair, Edge)

def test_node_a1_and_b1_contains_vlan_metadata(self):
vlans = self.netmap_graph.nodes[self.a]['metadata']['vlans']
Expand Down

0 comments on commit 3f768be

Please sign in to comment.