Skip to main content

A pytest-based tool to list test fixtures declared but not used in a test

Project description



A tool to list test fixtures declared but not used in a test:


This tool is actually a pytest plugin, and with some improved packaging could be installed, and then called via the py.test command line.


  • Uses the pytest collection to get a list of tests and available fixtures
  • Parses the code for each function to determine whether fixture arguments are used or not in the test
  • Supports a list of "ignored" fixtures, since some fixtures are only used to create and tear down a particular context, and might not be used directly in the test code


You can install loofah via pip:

$ pip install loofah


Since loofah relies on pytest collecting and being able to execute the tests, it needs to be run from your normal development shell, and probably installed in the venv of your project.

So, from your normal development shell, run loofah as you would run your tests: (ie with any required environment variables or virtual environment enabled, etc)

$ loofah test/unit
test/unit/ in test_account_update_requires_login detected 1 unused fixture:
test/unit/ in test_account_locks_after_three_attempts detected 2 unused fixtures:

Why 'loofah' ?

Why name this project after a fruit with fibrous, spongy interior often used to clean hard-to-reach areas of the human body? That's a mystery indeed.


Distributed under the terms of the MIT_ license, "loofah" is free and open source software

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loofah-0.2.0.tar.gz (4.4 kB view hashes)

Uploaded source

Built Distribution

loofah-0.2.0-py2-none-any.whl (3.8 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page