Metadata-Version: 2.1
Name: pytest-remove-stale-bytecode
Version: 6.0
Summary: py.test plugin to remove stale byte code files.
Home-page: https://github.com/gocept/pytest-remove-stale-bytecode/
Author: gocept <mail@gocept.com>
Author-email: mail@gocept.com
License: MIT
Keywords: pytest pyc bytecode artefacts
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Requires-Python: >= 3.7
License-File: LICENSE.txt
Requires-Dist: pytest
Requires-Dist: setuptools

=======================================
py.test plugin to remove stale bytecode
=======================================

.. image:: https://img.shields.io/pypi/v/pytest-remove-stale-bytecode.svg
    :target: https://pypi.org/project/pytest-remove-stale-bytecode/

.. image:: https://img.shields.io/pypi/pyversions/pytest-remove-stale-bytecode.svg
    :target: https://pypi.org/project/pytest-remove-stale-bytecode/

.. image:: https://github.com/gocept/pytest-remove-stale-bytecode/workflows/tests/badge.svg
    :target: https://github.com/gocept/pytest-remove-stale-bytecode/actions?query=workflow%3Atests


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``).

.. caution::

   This plug-in only looks into the packages you are testing. If there is a stale bytecode file
   in another package it does not remove it.

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`_.

.. _`zope.testrunner`: https://pypi.python.org/pypi/zope.testrunner


=======
CHANGES
=======


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 <https://github.com/gocept/pytest-remove-stale-bytecode/issues/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 <https://github.com/pytest-dev/pytest/pull/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
