Skip to content

Commit f30d9bf

Browse files
committed
Create patch release
1 parent 88cbe22 commit f30d9bf

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

pytest_describe/plugin.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import pytest
44

55

6-
PYTEST_GTE_7_0 = (
7-
hasattr(pytest, 'version_tuple') and pytest.version_tuple >= (7, 0)
8-
)
9-
PYTEST_GTE_5_4 = hasattr(pytest.Collector, 'from_parent')
6+
PYTEST_GTE_7_0 = getattr(pytest, 'version_tuple', (0, 0)) >= (7, 0)
7+
PYTEST_GTE_5_4 = PYTEST_GTE_7_0 or hasattr(pytest.Collector, 'from_parent')
108

119

1210
def trace_function(funcobj, *args, **kwargs):
@@ -66,27 +64,28 @@ class DescribeBlock(pytest.Module):
6664

6765
@classmethod
6866
def from_parent(cls, parent, obj):
67+
"""Construct a new node for the describe block"""
6968
name = getattr(obj, '_mangled_name', obj.__name__)
7069
nodeid = parent.nodeid + '::' + name
7170
if PYTEST_GTE_7_0:
7271
self = super().from_parent(
73-
parent=parent, path=parent.path, nodeid=nodeid,
74-
)
72+
parent=parent, path=parent.path, nodeid=nodeid)
7573
elif PYTEST_GTE_5_4:
7674
self = super().from_parent(
77-
parent=parent, fspath=parent.fspath, nodeid=nodeid,
78-
)
75+
parent=parent, fspath=parent.fspath, nodeid=nodeid)
7976
else:
8077
self = cls(parent=parent, fspath=parent.fspath, nodeid=nodeid)
8178
self.name = name
8279
self.funcobj = obj
8380
return self
8481

8582
def collect(self):
83+
"""Get list of children"""
8684
self.session._fixturemanager.parsefactories(self)
8785
return super().collect()
8886

8987
def _getobj(self):
88+
"""Get the underlying Python object"""
9089
return self._importtestmodule()
9190

9291
def _importtestmodule(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='pytest-describe',
10-
version='2.0.0',
10+
version='2.0.1',
1111
description='Describe-style plugin for pytest',
1212
long_description=readme,
1313
long_description_content_type='text/x-rst',

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ commands = pytest -rw {posargs}
2525

2626
[testenv:flake8]
2727
basepython = python3.9
28-
deps = flake8>=3.9,<4
28+
deps = flake8>=4,<5
2929
commands =
3030
flake8 pytest_describe test setup.py
3131

0 commit comments

Comments
 (0)