-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
WIP: Add a simple way to mark tests as xfail inside test #10096
base: main
Are you sure you want to change the base?
Conversation
TODO: discuss API in pytest-dev#9027 TODO: write documentation TODO: write changelog entry TODO: add me to AUTHORS TODO: fix linting errors TODO: write proper commit message
c1f9a5e
to
58f5e7b
Compare
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.
If we introduce that contextvar, we need to do it correct and aware of threads and async
|
||
|
||
def pytest_runtest_protocol(item: Item, nextitem: Optional[Item]) -> None: | ||
current_item_var.set(item) |
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.
This is completely missing cleanup and self protection, it's basically breaking pytester in a hidden way
src/_pytest/skipping.py
Outdated
|
||
def expect_failure(**kwargs) -> None: | ||
# TODO: raise proper error, test | ||
assert kwargs.get("run", True) |
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.
Just give the function a correct signature, run is not part of the equation here, don't allow it
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.
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.
done
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.
See also #10094.
TODO: put _XfailMarkDecorator fix into its own pull request TODO: squash into previous commit
58f5e7b
to
d510bbe
Compare
@manueljacob would you like to pick this up again and see, if we can get it merged or would it be better to close and have a fresh go at a later point? |
Closes #9027.
TODO: discuss API in #9027
TODO: write documentation
TODO: write changelog entry
TODO: add me to AUTHORS
TODO: fix linting errors
TODO: write proper commit message