Skip to main content

py.test plugin to remove stale bytecode

https://img.shields.io/pypi/v/pytest-remove-stale-bytecode.svg https://img.shields.io/pypi/pyversions/pytest-remove-stale-bytecode.svg https://github.com/minddistrict/pytest-remove-stale-bytecode/actions/workflows/tests.yml/badge.svg

Description

This plugin removes stale bytecode files of the packages under test before running tests. This makes sure that Python modules – whose source was deleted – are not accidentally visible to the test runner anymore due to a left-over bytecode file (*.pyc, *.pyo).

Usage

To use this plugin you just have to install it, so it is accessible by the pytest you are using:

  • If you are using buildout, add pytest-remove-stale-bytecode to the buildout section of your pytest runner.

  • If you are using pip add it to your test requirements.

Per default, there is no output generated, but if pytest is invoked in verbose mode (-v), information about the deleted files is printed.

This plugin was inspired by a feature of zope.testrunner.

CHANGES

7.0 (2025-11-19)

Backwards incompatible changes

  • Drop support for Python 3.7, 3.8, 3.9.

Features

  • Add support for Python 3.12, 3.13, 3.14.

  • Update tests to pytest >= 7.4.

Other changes

  • Fix installed module name (#7)

  • Replace deprecated pkg_resources with importlib.metadata.

6.0 (2023-07-07)

Backwards incompatible changes

  • Drop support for Python 3.5 and 3.6.

Features

  • Add support for Python 3.9, 3.10, 3.11.

  • Update tests to pytest >= 6.2.

Other changes

  • Use Github actions as CI.

5.0.1 (2020-03-04)

  • Calling pytest –help no longer breaks when this plug-in is installed.

5.0 (2020-01-17)

Backwards incompatible changes

  • Drop support for Python 2.7 and PyPy2.

Features

  • Add support for Python 3.8.

  • Migrate to Github.

  • Improve for new pytest versions.

Bug fixes

  • Fix problems when running tests jobs in parallel. (#2)

4.0 (2019-09-13)

Backwards incompatible changes

  • Drop support for Python 3.4.

Features

  • Make work with py.test >=3.10 again.

  • Add support for Python 3.7.

3.0.1 (2019-03-21)

  • This plug-in only works in py.test < version 3.10. It is broken since the merge of pytest-dev/pytest#4250

  • Drop support for Python 3.3.

3.0 (2017-05-12)

  • Add support for Python 3.6, PyPy2 and PyPy3.

  • Do not show output by default anymore. It can be turned on with -v option.

  • Change the license from ZPL to MIT.

2.1 (2015-10-01)

  • Also remove bytecode files under Python 3, that end with -PYTEST.

2.0 (2015-10-01)

  • Add support for removing byte code files under Python 3.

1.0 (2014-10-29)

  • initial release

Download files

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

Source Distribution

pytest_remove_stale_bytecode-7.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_remove_stale_bytecode-7.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest_remove_stale_bytecode-7.0.tar.gz.

File metadata

File hashes

Hashes for pytest_remove_stale_bytecode-7.0.tar.gz
Algorithm Hash digest
SHA256 d9f97ec403f97e91d6cba4d7cc20db5d3e6338eb4db79859567b14635b93f644
MD5 6a321d57d6652c6177939f09d5d305cb
BLAKE2b-256 2f6d3f3f3591f079f1fdf0912311b7efeaf9b5d531432926b761edd0810b075a

See more details on using hashes here.

File details

Details for the file pytest_remove_stale_bytecode-7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_remove_stale_bytecode-7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b206bcc75bb129a97389d347b7d04b5bd4fad02dae10422df74a55d6c532be46
MD5 13ae6d0a3791eb9310c12c566c96c149
BLAKE2b-256 35ce4df17ac4a222f4fa9167ccba9b7fc72be2bfc74f3a2deec4a1fc5dbbab67

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

7.0 This release

2 files

6.0

2 files

5.0.1

2 files

5.0

2 files

4.0.1

2 files

4.0

2 files

3.0.1

2 files

3.0

2 files

2.1

1 file

2.0

1 file

1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page