fix(tests): register JSON fixture fork marker#3053
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3053 +/- ##
================================================
Coverage 93.22% 93.22%
================================================
Files 624 624
Lines 36926 36926
Branches 3377 3377
================================================
Hits 34424 34424
Misses 1708 1708
Partials 794 794
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
danceratopz
left a comment
There was a problem hiding this comment.
Sorry, #1407 is an old issue and I don't think it's required any longer. Could you share the command you're using and the warnings that this change fixes? I.e., can you still reproduce them locally before this change. I had a quick go and couldn't create the warnings.
| "json_state_tests: marks tests as json_state_tests (deselect with '-m \"not json_state_tests\"')", | ||
| "vm_test: marks tests as vm_test (deselect with '-m \"not vm_test\"')", | ||
| "eels_base_coverage: Minimized subset selected to preserve high EELS line-coverage parity (select with '-m eels_base_coverage')", | ||
| "fork(name): marks JSON fixture tests by fork", |
There was a problem hiding this comment.
I'm not sure this would actually match any marker as name is not a valid fork name (as noted in #1407).
There was a problem hiding this comment.
Thank you. I updated the marker registration from fork(name) to fork: ... to
avoid implying that name is a fork value.
3ec94e0 to
92aa3b8
Compare
|
Oh, Sorry. I think the difference is that my checkout has generated JSON fixtures under So this PR only fixes the warning for collecting generated JSON fixtures, not for a clean default pytest run. Since the issue is old, if that workflow is no longer considered supported or relevant, I'm happy to close this PR. |
|
On .venv/bin/pytest --collect-only -q tests/json_loader/fixtures/blockchain_tests/for_frontier/frontier/validation/transaction/sender_balance.json -W "error::pytest.PytestUnknownMarkWarning"This fails before the change with: E pytest.PytestUnknownMarkWarning: Unknown pytest.mark.fork - is this a typo? You can register custom marks to avoid this warningThe warning is triggered from: self.add_marker(pytest.mark.fork(self.fork_name))in After this PR, the same command passes with |
🗒️ Description
Register the
fork(name)pytest marker used by JSON fixture tests.JSON fixture collection adds
pytest.mark.fork(...)to collected tests, but the marker was not registered in the root pytest configuration. This causedPytestUnknownMarkWarningduring pytest runs. Registering the marker inpyproject.tomlsilences the warning without changing test behavior.🔗 Related Issues or PRs
Fixes #1407.
✅ Checklist
just statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture