pytest: port eip spec version checking to a pytest plugin #12
+84
−24
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.
This PR ports the reference spec checking by implementing the functionality in a pytest plugin:
spec_version_checker
.If the checks fail, they get reported as warnings in the pytest test summary.
See for example the following two runs that report warnings that:
There is no way from pytest's exit codes to tell whether warnings were raised. If we want to be able to check whether these warnings are present, via CI, for example, we'd have to run pytest as:
pytest -W error
This won't run fillers though, as it's currently implemented, as the warning gets treated as an error in test setup. This will also treat all warnings in the test session as errors, with a bit more work, we could filter using our custom warnings using, for example,
pytest -W error::NoReferenceSpecDefined
In general, however, the output using

-W error::
is very noisy as an error for every test is raised. The following is example output with-x
(stop after first fail):