-
Notifications
You must be signed in to change notification settings - Fork 243
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
Remove usage of funcargs #283
Remove usage of funcargs #283
Conversation
I can confirm that this patch work fine. Can we please merge it and have a dot release? |
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.
Worked for me, thanks!
@BeyondEvil @davehunt please review. |
I'll try to get around to releasing this today. Whole family is sick, so I'm pretty low on energy unfortunately. I appreciate everyones' input! |
In an effort to avoid globals (I have a personal crusade against them), here's my suggestion: @pytest.fixture
def extra(pytestconfig):
"""Add details to the HTML reports.
.. code-block:: python
import pytest_html
def test_foo(extra):
extra.append(pytest_html.extras.url('http://www.example.com/'))
"""
pytestconfig.extras = []
yield pytestconfig.extras
del pytestconfig.extras[:] which would turn
into
Thoughts @christiansandberg @ssbarnea @nicoddemus @RonnyPfannschmidt ? |
Found a bug (present in all solutions). The extra is not emptied between tests, so if test A sets an extra and is run before test B that doesn't, test B still gets the extra. Will work on a fix. |
I’m also home with the kids, trying to get some work done. 🙄 Attaching it to the config is fine, although that’s also pretty much global. Maybe you can empty the list on teardown instead? |
I feel you! ❤️
Yes, but in a much more controlled way 😊
See my updated solution 😉 |
Looks like these tests are failing on master as well. Not sure why or how. Please confirm. If true, I'll see if I can fix it. |
The lastest build to pass was the release of v2.1.0 And I don't see that anything has been merged since. 🤔 |
It's the warning causing the failure:
Something must've changed in the latest release of pytest. |
Seems to be an issue with the pytest plugin test utility I've logged an issue: pytest-dev/pytest#6936 |
Here's a temporary fix until the root cause is fixed:
So that we can get this merged and I can make a hotfix. @ssbarnea @christiansandberg |
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.
Banging job everyone! 👊
Sorry for messing up. 🙏 |
No worries! You fixed it, right? 😉 |
Fixes #282