128: pytest-randomly - Adam Johnson
Software tests should be order independent. That means you should be able to run them in any order or run them in isolation and get the same result.
However, system state often gets in the way and order dependence can creep into a test suite.
One way to fight against order dependence is to randomize test order, and with pytest, we recommend the plugin pytest-randomly to do that for you.
One way to fight against order dependence is to randomize test order, and with pytest, we recommend the plugin pytest-randomly to do that for you.
The developer that started pytest-randomly and continues to support it is Adam Johnson, who joins us today to discuss pytest-randomly and another plugin he also wrote, called pytest-reverse.
Special Guest: Adam Johnson.
Links:
- pytest-randomly: pytest plugin to randomly order tests and control random.seed
- pytest-reverse: pytest plugin to reverse test order.
- Empirically revisiting the test independence assumption
- pytest-xdist
- factory_boy
- Faker
- NumPy
- Hyrum's Law
Help support the show AND learn pytest:
- The Complete pytest course is now a bundle, with each part available separately.
- pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively.
- Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI
- Then pytest Booster Rockets can help with advanced parametrization and building plugins.
- Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.
Creators and Guests
