Skip to content

Commit

Permalink
Fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Sep 2, 2023
1 parent 34c78e5 commit c58167b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ def pytest_collection_modifyitems(session, config, items):
assert isinstance(item, _pytest.python.Function)

# unittest-style test functions have the node of UnitTest class as parent
assert isinstance(
item.parent,
(
_pytest.python.Class, # pytest >= 7.0.0
_pytest.python.Instance, # pytest < 7.0.0
),
)
if tuple(map(int, _pytest.__version__.split("."))) >= (7,):
assert isinstance(item.parent, _pytest.python.Class)
else:
assert isinstance(item.parent, _pytest.python.Instance)

# and that node references the UnitTest class
assert issubclass(item.parent.cls, _IrcTestCase)
Expand Down

0 comments on commit c58167b

Please sign in to comment.