Skip to content

Commit 1313719

Browse files
committed
test: remove @tag parsing from record_props fixture
These tags were removed in 07e564c, so the logic serves no purpose anymore (and it makes pytest print very unhelpful error messages if a test function has no doc string). Signed-off-by: Patrick Roy <[email protected]>
1 parent 314d51d commit 1313719

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

tests/conftest.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,7 @@ def record_props(request, record_property):
9999

100100
# Extract attributes from the docstrings
101101
function_docstring = inspect.getdoc(request.function)
102-
description = []
103-
attributes = {}
104-
for line in function_docstring.split("\n"):
105-
# extract tags like @type, @issue, etc
106-
match = re.match(r"\s*@(?P<attr>\w+):\s*(?P<value>\w+)", line)
107-
if match:
108-
attr, value = match["attr"], match["value"]
109-
attributes[attr] = value
110-
else:
111-
description.append(line)
112-
for attr_name, attr_value in attributes.items():
113-
record_property(attr_name, attr_value)
114-
record_property("description", "".join(description))
102+
record_property("description", function_docstring)
115103

116104

117105
def pytest_runtest_logreport(report):

0 commit comments

Comments
 (0)