-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix for xdist-grouping #9
base: master
Are you sure you want to change the base?
Conversation
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.
Add a comment on the changed lines explaining why this was needed in case someone wonders later on or someone would have issues.
@@ -134,7 +134,7 @@ def pytest_report_collectionfinish(self, config, items): | |||
self.context["items"] = self._items | |||
|
|||
def pytest_runtest_logstart(self, nodeid): | |||
testrun = self._get_testrun(nodeid) | |||
testrun = self._get_testrun(nodeid.split('@', 1)[0]) |
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.
I guess the _get_testrun() method does not need to be modified if the input has already been processed?
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.
@christiansandberg
If I don't change inside _get_testrun() method, its getting failed somewhere in Jinja2 lib.
I am new to Python, still analyzing why/where its failing.
If possible, Can you please help fixing this for the issue mentioned here,
christiansandberg/pytest-reporter-html1#16
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.
@christiansandberg - Can you please help on this.
Could you try the latest master. I made a commit (a51474f) trying to fix it and a unit test for it, but I haven't tested it in a real environment. |
Will test it. |
Does this fix work and is there any chance to get it any time soon? |
If it doesn't work in the latest release then a new PR probably needs to be made. |
Unfortunately I'm encountering this problem with the latest release of pytest-reporter-html1 (0.8.4), but it's super flaky. Sometimes it passes and sometimes fails with |
And you have the latest version of pytest-reporter also? Sometimes pip does not update dependencies automatically. But I wouldn't be surprised if there were more details regarding xdist that need to be taken into consideration. Unfortunately I don't use it myself so it doesn't get much testing in real life. |
Yes, i also have the latest version of pytest-reporter (0.5.3) :( |
@christiansandberg
Please have a look.
While using marker @pytest.mark.xdist_group for a test as below and running with command --dist=loadgroup, report does not get generated.
Issue looks like:
nodeid comes as module::class::method**@group**
The one above in bold creates issue, and does not create report.
Script example:
tests\test_first.py
class TestA:
@pytest.mark.xdist_group("group1")
def test1():
pass
Run as:
pytest tests\test_first -n 1 --dist loadgroup
Attached error:
Xdist.grp.html.report.issue.txt