Rename 'properties' to 'markers' in PytestJSONReportParser for consis… #1083
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



…tensy
We have used
propertiesto store the metadata in JSON report files. However, as you can see,user_propertiesfield of JSON report files corresponds to the<properties>tag of XML report files. So, we should rename 'properties' to 'markers' for consistency.Example script
Example report files
{"pytest_version": "8.4.1", "$report_type": "SessionStart"} {"nodeid": "", "outcome": "passed", "longrepr": null, "result": null, "sections": [], "$report_type": "CollectReport"} {"nodeid": "tests/funcs3_test.py", "outcome": "passed", "longrepr": null, "result": null, "sections": [], "$report_type": "CollectReport"} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 3, "message": "Unknown pytest.mark.foo - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 4, "message": "Unknown pytest.mark.order - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 5, "message": "Unknown pytest.mark.dependency - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 9, "message": "Unknown pytest.mark.bar - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 10, "message": "Unknown pytest.mark.order - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"category": "PytestUnknownMarkWarning", "filename": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 11, "message": "Unknown pytest.mark.dependency - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html", "$report_type": "WarningMessage", "when": "collect", "location": null} {"nodeid": "tests/funcs3_test.py::test_func4", "location": ["tests/funcs3_test.py", 2, "test_func4"], "keywords": {"test_func4": 1, "dependency": 1, "order": 1, "foo": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "passed", "longrepr": null, "when": "setup", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "a"}], ["name", "order"], ["args", [1]], ["kwargs", {}], ["name", "foo"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.00035070799640379846, "start": 1753415193.5733702, "stop": 1753415193.5737212, "$report_type": "TestReport"} {"nodeid": "tests/funcs3_test.py::test_func4", "location": ["tests/funcs3_test.py", 2, "test_func4"], "keywords": {"test_func4": 1, "dependency": 1, "order": 1, "foo": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "passed", "longrepr": null, "when": "call", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "a"}], ["name", "order"], ["args", [1]], ["kwargs", {}], ["name", "foo"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.000283499997749459, "start": 1753415193.573865, "stop": 1753415193.5741482, "$report_type": "TestReport"} {"nodeid": "tests/funcs3_test.py::test_func4", "location": ["tests/funcs3_test.py", 2, "test_func4"], "keywords": {"test_func4": 1, "dependency": 1, "order": 1, "foo": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "passed", "longrepr": null, "when": "teardown", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "a"}], ["name", "order"], ["args", [1]], ["kwargs", {}], ["name", "foo"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.0002451249965815805, "start": 1753415193.57428, "stop": 1753415193.5745249, "$report_type": "TestReport"} {"nodeid": "tests/funcs3_test.py::test_func5", "location": ["tests/funcs3_test.py", 8, "test_func5"], "keywords": {"test_func5": 1, "dependency": 1, "order": 1, "bar": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "passed", "longrepr": null, "when": "setup", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "b", "depends": ["a"]}], ["name", "order"], ["args", [2]], ["kwargs", {}], ["name", "bar"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.0002393750037299469, "start": 1753415193.5747368, "stop": 1753415193.574976, "$report_type": "TestReport"} {"nodeid": "tests/funcs3_test.py::test_func5", "location": ["tests/funcs3_test.py", 8, "test_func5"], "keywords": {"test_func5": 1, "dependency": 1, "order": 1, "bar": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "failed", "longrepr": {"reprcrash": {"path": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 13, "message": "assert 1 == False"}, "reprtraceback": {"reprentries": [{"type": "ReprEntry", "data": {"lines": [" @pytest.mark.bar", " @pytest.mark.order(2)", " @pytest.mark.dependency(name=\"b\", depends=[\"a\"])", " def test_func5():", "> assert 1 == False", "E assert 1 == False"], "reprfuncargs": {"args": []}, "reprlocals": null, "reprfileloc": {"path": "tests/funcs3_test.py", "lineno": 13, "message": "AssertionError"}, "style": "long"}}], "extraline": null, "style": "long"}, "sections": [], "chain": [[{"reprentries": [{"type": "ReprEntry", "data": {"lines": [" @pytest.mark.bar", " @pytest.mark.order(2)", " @pytest.mark.dependency(name=\"b\", depends=[\"a\"])", " def test_func5():", "> assert 1 == False", "E assert 1 == False"], "reprfuncargs": {"args": []}, "reprlocals": null, "reprfileloc": {"path": "tests/funcs3_test.py", "lineno": 13, "message": "AssertionError"}, "style": "long"}}], "extraline": null, "style": "long"}, {"path": "/Users/ono-max/src/github.com/launchableinc/examples/pytest/tests/funcs3_test.py", "lineno": 13, "message": "assert 1 == False"}, null]]}, "when": "call", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "b", "depends": ["a"]}], ["name", "order"], ["args", [2]], ["kwargs", {}], ["name", "bar"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.0003500829989206977, "start": 1753415193.575045, "stop": 1753415193.575395, "$report_type": "TestReport"} {"nodeid": "tests/funcs3_test.py::test_func5", "location": ["tests/funcs3_test.py", 8, "test_func5"], "keywords": {"test_func5": 1, "dependency": 1, "order": 1, "bar": 1, "pytestmark": 1, "funcs3_test.py": 1, "tests": 1, "pytest": 1, "": 1}, "outcome": "passed", "longrepr": null, "when": "teardown", "user_properties": [["name", "dependency"], ["args", []], ["kwargs", {"name": "b", "depends": ["a"]}], ["name", "order"], ["args", [2]], ["kwargs", {}], ["name", "bar"], ["args", []], ["kwargs", {}]], "sections": [], "duration": 0.00026429099671076983, "start": 1753415193.587457, "stop": 1753415193.587722, "$report_type": "TestReport"} {"exitstatus": 1, "$report_type": "SessionFinish"}