Tags » python » pytest
TIL: Collecting pytest markers from failing tests
You can annotate tests with markers, and using the
pytest_collection_modifyitemsandpytest_terminal_summaryhooks you can get a list of markers for tests that failed.TIL: How to simulate an
[Errno 54] Connection reset by peerwhen using pytestYou can run a TCP server in the background using a fixture, and using the
SO_LINGERsocket option can reset the connection.TIL: Run a randomly selected subset of tests with pytest
By reading the code for the
pytest-random-orderplugin, I was able to write a new plugin that runs a random subset of tests.Why I use py.test
Why py.test is my unit test framework of choice in Python.