Metadata-Version: 2.1
Name: pytest-super-check
Version: 2.1.0
Summary: Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc.
Home-page: https://github.com/adamchainz/pytest-super-check
Author: Adam Johnson
Author-email: me@adamj.eu
License: BSD
Project-URL: Changelog, https://github.com/adamchainz/pytest-super-check/blob/master/HISTORY.rst
Keywords: pytest,super,unittest,testcase
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.5
Description-Content-Type: text/x-rst
License-File: LICENSE

==================
pytest-super-check
==================

.. image:: https://img.shields.io/travis/adamchainz/pytest-super-check.svg
        :target: https://travis-ci.org/adamchainz/pytest-super-check

.. image:: https://img.shields.io/pypi/v/pytest-super-check.svg
        :target: https://pypi.python.org/pypi/pytest-super-check

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/python/black

Pytest plugin to check your TestCase classes call super in setUp, tearDown,
etc.

Features
========

This plugin checks all ``TestCase`` classes in your test suite to ensure that
their ``setUp``, ``tearDown``, ``setUpClass``, ``tearDownClass``, and
``setUpTestData`` (Django extension) methods all call ``super()``. You might
care about this when you have extensions to these methods in your project
specific base class that when skipped (by accidentally missing ``super()``),
cause subtle bugs.

About
=====

I developed this feature in a closed source Nose plugin whilst working on the
big Django project at YPlan. We had some custom enhancements and fixes on top
of the Django test classes, but some ``TestCase`` classes didn't call
``super()`` in e.g. ``setUp``, which caused the tests to fail, or incorrectly
pass, in rather subtle ways. This problem is exacerbated by Django's ``setUp``
etc. doing magic around not requiring ``super()`` to be called. Our solution
was to just ensure every ``TestCase`` always calls ``super()`` in those
methods. This is a Pytest port of that plugin.

Installation
============

Install from pip with:

.. code-block:: bash

    pip install pytest-super-check

Python 3.5 to 3.8 supported.

Usage
=====

Pytest will automatically find and use the plugin. Test discovery will then
blow up if any subclasses of ``unittest.TestCase`` are found that have
``setUp`` etc. methods that don't call ``super()``.

You can disable the plugin by passing the options ``-p no:super_check`` to
``pytest``.

History
=======

2.1.0 (2019-12-19)
------------------

* Update Python support to 3.5-3.8, as 3.4 has reached its end of life.
* Converted setuptools metadata to configuration file. This meant removing the
  ``__version__`` attribute from the package. If you want to inspect the
  installed version, use
  ``importlib.metadata.version("pytest-super-check")``
  (`docs <https://docs.python.org/3.8/library/importlib.metadata.html#distribution-versions>`__ /
  `backport <https://pypi.org/project/importlib-metadata/>`__).

2.0.0 (2019-02-28)
------------------

* Drop Python 2 support, only Python 3.4+ is supported now.

1.0.0 (2016-04-22)
------------------

* First release on PyPI
