Skip to content
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

Add scenario for pytest.raises() with pytest.fail() in context manager #210

Open
jamescooke opened this issue Mar 17, 2023 · 0 comments
Open

Comments

@jamescooke
Copy link
Owner

As per Pytest deprecations documentation, message= is deprecated. That all seems fine 👍🏻

However, the suggested solution packs a pytest.fail() into the context manager:

with pytest.raises(TimeoutError):
    wait_for(websocket.recv(), 0.5)
    pytest.fail("Client got unexpected message")

At the very least this needs a new "good" example to be added to ensure that it works with AAA.

However, my guess is that we might need some fixes / adjustment for default or greedy act blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant