Skip to main content

loofah

CircleCI

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

image

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


Features

  • 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

Installation

You can install loofah via pip:

$ pip install loofah

Usage

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/account_tests.py:10 in test_account_update_requires_login detected 1 unused fixture:
    user
test/unit/account_tests.py:28 in test_account_locks_after_three_attempts detected 2 unused fixtures:
    user
    monkeypatch

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.

License

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

Metadata

Release files for loofah 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loofah 0.2.0
File Size Uploaded
loofah-0.2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loofah 0.2.0
File Interpreter ABI Platform
loofah-0.2.0-py2-none-any.whl Python 2 none any Details

Total release size: 8.2 kB

Release files / loofah-0.2.0.tar.gz

Download URL loofah-0.2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8a3ab9346969c72ee0fa72ff3d9dfea423c9154beb8049f995b6c01928d88335
BLAKE2b-256 checksum
How to use checksums
09e7f102acfcb80ecb5e5d6f36878aec9df5c99cc6b1e62ea1c64e4c84fe9ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / loofah-0.2.0-py2-none-any.whl

Download URL loofah-0.2.0-py2-none-any.whl
Size 3.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
16c057cab6e49527388c26b54bcba0a136190b49c0230bc0cbf9963a92660981
BLAKE2b-256 checksum
How to use checksums
6887330004d87766abee4579e733bf5018d9ca87094e299d4cb952d27511b52c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page