Fix reported location of skip when --runxfail is used#7432
Fix reported location of skip when --runxfail is used#7432bluetech merged 6 commits intopytest-dev:masterfrom
Conversation
gnikonorov
left a comment
There was a problem hiding this comment.
Hey @AFirouzi thank you for the PR!
Can you please also include the following?
- A changelog as explained here
- Tests for this change.
Sorry, I am a newbie here. If I got your point correctly, I need to write a test for this specific bug right? which in this case is it should be add to the test_skipping.py |
|
@AFirouzi yes please. I think test_skipping.py sounds like a great place to put it Also, consider using github keywords to close any linked issues otherwise someone has to manually close them. It also has the benefit of showing in the issue that there is a linked PR, so people know someone has a solution up for review |
|
Fixes #7392 |
gnikonorov
left a comment
There was a problem hiding this comment.
Reading over the issue, it would appear that the issue is the reporting.
Adding --runxfail shows the error as coming from src/_pytest/skipping.py, but it should show the test file (e.g.: test_it.py ). Can you update the tests to check for this condition? I don't see the tests checking the file location outputted
@bluetech please correct me if I'm wrong
|
@gnikonorov is right, the problem is not what the current changelog entry states, but merely that The fix is also not quite right; the actual problem is that the "change the location of the failure to point to the item definition" code is currently dependent on previous conditions (uses |
|
Now I think I got the issue right. I just needed to simply replace last |
|
(I edited the PR title to be more descriptive, and added |
Fixes #7392.