Starting with a Cool Idea
Maybe “cool idea” is too strong a phrase. An idea doesn’t have to be really that cool to deserve being made into a plugin. It just needs to be helpful. You may have a fixture or command-line flag that’s useful on one project, and you want to use on other projects. That’s good enough for plugin-hood.
As an example, we’ll grab an idea from the pytest documentation about slow tests. The pytest documentation[55] includes an examples page with a description of how to skip tests that are marked with @pytest.mark.slow automatically.
Here’s the idea (the documentation actually uses --runslow, but we’ll use --slow because it’s shorter and seems like a better flag to me):
-
Mark tests with @pytest.mark.slow that are so slow you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access