-
Notifications
You must be signed in to change notification settings - Fork 40
Fix #165: empty parameter set error #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
==========================================
- Coverage 91.22% 91.19% -0.03%
==========================================
Files 130 131 +1
Lines 5025 5031 +6
==========================================
+ Hits 4584 4588 +4
- Misses 441 443 +2
Continue to review full report at Codecov.
|
71624c2 to
56330d7
Compare
|
Thanks @plammens for this PR ! I did not yet bother using the So I wonder, maybe there is a way to get this globally instead of hacking in the pytest internals ?
|
That seems way better, I'll take a look! |
56330d7 to
59eff0b
Compare
59eff0b to
75c3a93
Compare
|
Allright, I used your suggestion above: when the |
smarie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect ! Nicely done, thanks @plammens
The only public way to access the correct
configobject seems to be through thepytestconfigfixture, however I don't know how to get a hold of that outside a test function. So I usedget_configfrom_pytest.config. No idea whether this is the correct approach but at least the test passes 😅Update:
After taking a walk through pytest code with the company of a debugger, it seems the point at which the config object is constructed is here:
https://github.com/pytest-dev/pytest/blob/ad65e816e4612af4413711200f9e58d74e765a3a/src/_pytest/config/__init__.py#L143
Hence probably
_prepare_configis the way to go? For now this PR adds a cached lazy_get_configstatic method toMiniMetafuncthat calls_prepare_config. Ideally though it would be best to reuse the config object that pytest has already computed, but I have no idea how to get that from theMiniMetafunccode.Fixes #165