10 Posts Tagged ‘pytest’

(All tags.)

Shell Tricks for Repeatedly Running Flaky Tests

shell be coming round the mountain when shell comes

Investigating flaky tests is a dull necessity of testing. At least it is (in the best case) infrequent. Here are some shell commands you can use to automate steps in your investigations. These will work on (at least) bash and zsh.


How to Fix a PytestCollectionWarning about WebTest’s TestApp Class

Honk away, test warning goose

Here’s a small warning I’ve come across a couple of times, and how to fix it with a niche pytest feature.


“Speed Up Your Django Tests” is Out Now

Hand Scroll

My previously announced book “Speed Up Your Django Tests” is out now on Gumroad. I’ve been writing since the 3rd March, so it’s quite a relief to have launched it.


Book Announcement: Speed Up Your Django Tests

Penelope the Performance Pegasus

At the start of March I started writing a blog post called “How to Speed Up Your Django Tests”. Before I knew it, the outline alone was 4,000 words! I realized writing it up would be a major undertaking. As lockdown arrived, I found the time to write it all up.


Detect if Your Tests Are Running on a CI System

Test CI Telescope

If you have some slow tests in your suite, you might want to run them only on CI. To do this, you can detect in your test runner if you’re running on a CI system.


My Most Used pytest Commandline Flags

Look on ye Pytesters

pytest is quickly becoming the “standard” Python testing framework. However it can be overwhelming to new users.


Testing Boto3 with pytest Fixtures

Testing Apparatus

This is a recipe I’ve used on a number of projects. It combines pytest fixtures with Botocore’s Stubber for an easy testing experience of code using Boto3. (Botocore is the library behind Boto3.)


Solving Algorithmic Problems in Python with pytest

pytest Flute

I occasionally enjoy solving algorithmic problems, for example Project Euler or The Advent of Code. I’ve been doing them since I was a pimply PHP-slinging teenager, competing with my peers across the UK in the British Informatics Olympiad. It was terribly nerdy and terribly fun.


pytest-randomly history

Hall of history

My plugin pytest-randomly was recently moved into the pytest-dev organization on GitHub, making it a bit “more official” as a pytest plugin. Thanks to Bruno Oliveira for suggesting it, Florian Bruhin and Bruno for approving it on the pytest-dev mailing list, and Gordon Wrigley for helping with its development.


Introducing django-perf-rec, our Django performance testing tool

Performance matters!

During PyCon UK I had the opportunity to work on open-sourcing our in-house Django performance testing tool, which has now been released as django-perf-rec. We created it over two years ago, and have been using and improving it since. It has been helping us to pre-emptively fix performance problems in our code, and now it can help you!