pytest-tricks icon indicating copy to clipboard operation
pytest-tricks copied to clipboard

:smirk: Tips and Tricks for the Python Testing Tool

Results 20 pytest-tricks issues
Sort by recently updated
recently updated
newest added
trafficstars

Hi, great project! 👍 Thanks for all the efforts! I would suggest to add another tip to your great site: how to correctly use `patch` and `pytest.mark.parametrize` at the same...

help wanted
content

I would like to be able to construct a test as: ``` @pytest.mark.parametrize("method", ["trigger","activate"]) @mock.patch.object(ClassUnderTest, method) def test_verify_method_called_by_run(method_): uut = ClassUnderTest() uut.run() method_.assert_was_called() ``` But this results in `E NameError:...

Hi @nicoddemus! 👋🏻 It's been a while since we've added a new article to this blog and I don't think I have the bandwidth to maintain it anymore. What do...

content

## Problem I've noticed in some of the example, that `py.test` as a command is used. If I remember correctly, this is declared as deprecated. It could potentially be removed...

I can see this question coming up a lot :wink: Possible solutions include: - Returning a helper object/function from the fixture - Adding a marker on the test and reading...

help wanted
content

See https://github.com/pytest-dev/pytest/issues/2125

help wanted

See [pytest-emoji](https://github.com/hackebrot/pytest-emoji) 😁

content

- module fixtures - package conftest.py - ... - project conftest.py

help wanted
content