Hello community,
here is the log from the commit of package python-pytest-super-check for
openSUSE:Factory checked in at 2020-01-06 15:24:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-super-check (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-super-check.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-super-check"
Mon Jan 6 15:24:41 2020 rev:2 rq:761145 version:2.1.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pytest-super-check/python-pytest-super-check.changes
2019-03-22 15:11:55.097295042 +0100
+++
/work/SRC/openSUSE:Factory/.python-pytest-super-check.new.6675/python-pytest-super-check.changes
2020-01-06 15:24:42.180558989 +0100
@@ -1,0 +2,7 @@
+Mon Jan 6 13:01:29 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.1.0:
+ * Update Python support to 3.5-3.8, as 3.4 has reached its end of life.
+ * Converted setuptools metadata to configuration file.
+
+-------------------------------------------------------------------
Old:
----
pytest-super-check-2.0.0.tar.gz
New:
----
pytest-super-check-2.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-super-check.spec ++++++
--- /var/tmp/diff_new_pack.h3YWR2/_old 2020-01-06 15:24:42.652559232 +0100
+++ /var/tmp/diff_new_pack.h3YWR2/_new 2020-01-06 15:24:42.656559235 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-super-check
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,21 +18,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-super-check
-Version: 2.0.0
+Version: 2.1.0
Release: 0
Summary: Pytest plugin to check your TestCase classes call super in
setUp, tearDown, etc
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/adamchainz/pytest-super-check
Source:
https://files.pythonhosted.org/packages/source/p/pytest-super-check/pytest-super-check-%{version}.tar.gz
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pytest
BuildArch: noarch
-# SECTION test requirements
-BuildRequires: %{python_module pytest-runner}
-# /SECTION
%python_subpackages
%description
@@ -49,7 +47,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-%python_exec setup.py pytest
+%pytest
%files %{python_files}
%doc README.rst HISTORY.rst
++++++ pytest-super-check-2.0.0.tar.gz -> pytest-super-check-2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/HISTORY.rst
new/pytest-super-check-2.1.0/HISTORY.rst
--- old/pytest-super-check-2.0.0/HISTORY.rst 2019-02-28 07:13:59.000000000
+0100
+++ new/pytest-super-check-2.1.0/HISTORY.rst 2019-12-19 23:59:40.000000000
+0100
@@ -1,12 +1,16 @@
-.. :changelog:
-
History
--------
+=======
-Pending Release
----------------
+2.1.0 (2019-12-19)
+------------------
-.. Insert new release notes below this line
+* 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)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/PKG-INFO
new/pytest-super-check-2.1.0/PKG-INFO
--- old/pytest-super-check-2.0.0/PKG-INFO 2019-02-28 07:14:23.000000000
+0100
+++ new/pytest-super-check-2.1.0/PKG-INFO 2019-12-20 00:00:01.000000000
+0100
@@ -1,11 +1,12 @@
-Metadata-Version: 1.2
+Metadata-Version: 2.1
Name: pytest-super-check
-Version: 2.0.0
+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: [email protected]
License: BSD
+Project-URL: Changelog,
https://github.com/adamchainz/pytest-super-check/blob/master/HISTORY.rst
Description: ==================
pytest-super-check
==================
@@ -16,11 +17,14 @@
.. 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
@@ -30,7 +34,7 @@
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
@@ -41,8 +45,8 @@
was to just ensure every ``TestCase`` always calls ``super()`` in those
methods. This is a Pytest port of that plugin.
- Usage
- -----
+ Installation
+ ============
Install from pip with:
@@ -50,7 +54,10 @@
pip install pytest-super-check
- Python 3.4+ supported.
+ 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
@@ -59,24 +66,19 @@
You can disable the plugin by passing the options ``-p
no:super_check`` to
``pytest``.
- Caveats
- -------
-
- On Python 2, you'll need to ensure any decorators you use on your
``setUp``
- etc. methods set ``__wrapped__``, to allow decorator-unwrapping so the
inner
- source can be inspected. This is the default behaviour of
``functools.wraps``
- on Python 3 so you'll be more forwards compatible anyway.
-
-
-
-
History
- -------
+ =======
- Pending Release
- ---------------
+ 2.1.0 (2019-12-19)
+ ------------------
- .. Insert new release notes below this line
+ * 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)
------------------
@@ -95,8 +97,11 @@
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.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
-Requires-Python: >=3.4
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Requires-Python: >=3.5
+Description-Content-Type: text/x-rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/README.rst
new/pytest-super-check-2.1.0/README.rst
--- old/pytest-super-check-2.0.0/README.rst 2019-02-28 07:13:35.000000000
+0100
+++ new/pytest-super-check-2.1.0/README.rst 2019-11-21 12:52:46.000000000
+0100
@@ -8,11 +8,14 @@
.. 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
@@ -22,7 +25,7 @@
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
@@ -33,8 +36,8 @@
was to just ensure every ``TestCase`` always calls ``super()`` in those
methods. This is a Pytest port of that plugin.
-Usage
------
+Installation
+============
Install from pip with:
@@ -42,7 +45,10 @@
pip install pytest-super-check
-Python 3.4+ supported.
+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
@@ -50,11 +56,3 @@
You can disable the plugin by passing the options ``-p no:super_check`` to
``pytest``.
-
-Caveats
--------
-
-On Python 2, you'll need to ensure any decorators you use on your ``setUp``
-etc. methods set ``__wrapped__``, to allow decorator-unwrapping so the inner
-source can be inspected. This is the default behaviour of ``functools.wraps``
-on Python 3 so you'll be more forwards compatible anyway.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/PKG-INFO
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/PKG-INFO
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/PKG-INFO
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/PKG-INFO
1970-01-01 01:00:00.000000000 +0100
@@ -1,102 +0,0 @@
-Metadata-Version: 1.2
-Name: pytest-super-check
-Version: 2.0.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: [email protected]
-License: BSD
-Description: ==================
- 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
-
- 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.
-
- Usage
- -----
-
- Install from pip with:
-
- .. code-block:: bash
-
- pip install pytest-super-check
-
- Python 3.4+ supported.
-
- 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``.
-
- Caveats
- -------
-
- On Python 2, you'll need to ensure any decorators you use on your
``setUp``
- etc. methods set ``__wrapped__``, to allow decorator-unwrapping so the
inner
- source can be inspected. This is the default behaviour of
``functools.wraps``
- on Python 3 so you'll be more forwards compatible anyway.
-
-
-
-
- History
- -------
-
- Pending Release
- ---------------
-
- .. Insert new release notes below this line
-
- 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
-
-Keywords: pytest,super,unittest,testcase
-Platform: UNKNOWN
-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
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Requires-Python: >=3.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/SOURCES.txt
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/SOURCES.txt
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/SOURCES.txt
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/SOURCES.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-HISTORY.rst
-LICENSE
-MANIFEST.in
-README.rst
-pytest_super_check.py
-setup.cfg
-setup.py
-pytest_super_check.egg-info/PKG-INFO
-pytest_super_check.egg-info/SOURCES.txt
-pytest_super_check.egg-info/dependency_links.txt
-pytest_super_check.egg-info/entry_points.txt
-pytest_super_check.egg-info/not-zip-safe
-pytest_super_check.egg-info/requires.txt
-pytest_super_check.egg-info/top_level.txt
-tests/test_it.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/dependency_links.txt
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/dependency_links.txt
---
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/dependency_links.txt
2019-02-28 07:14:23.000000000 +0100
+++
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/dependency_links.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/entry_points.txt
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/entry_points.txt
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/entry_points.txt
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/entry_points.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-[pytest11]
-super_check = pytest_super_check
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/not-zip-safe
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/not-zip-safe
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/not-zip-safe
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/not-zip-safe
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/requires.txt
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/requires.txt
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/requires.txt
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/requires.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/pytest_super_check.egg-info/top_level.txt
new/pytest-super-check-2.1.0/pytest_super_check.egg-info/top_level.txt
--- old/pytest-super-check-2.0.0/pytest_super_check.egg-info/top_level.txt
2019-02-28 07:14:23.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.egg-info/top_level.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-pytest_super_check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/pytest_super_check.py
new/pytest-super-check-2.1.0/pytest_super_check.py
--- old/pytest-super-check-2.0.0/pytest_super_check.py 2019-02-28
07:14:08.000000000 +0100
+++ new/pytest-super-check-2.1.0/pytest_super_check.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,66 +0,0 @@
-import inspect
-from collections import defaultdict
-
-import pytest
-from _pytest.unittest import UnitTestCase
-
-__version__ = '2.0.0'
-
-
-def pytest_collection_modifyitems(session, config, items):
- errors = defaultdict(list)
-
- for item in items:
- parent = getattr(item, 'parent', None)
- if (
- parent is None or
- not isinstance(parent, UnitTestCase) or
- parent in errors
- ):
- continue
-
- klass = parent.cls
-
- for name in ('setUpClass', 'setUpTestData', 'setUp', 'tearDown',
'tearDownClass'):
- try:
- klass.__dict__[name]
- except KeyError:
- # Not defined in this class (may be in superclass)
- continue
-
- func = getattr(klass, name) # Fetch *bound* method
-
- real_func = get_real_func(func)
-
- # Unwrap any decorators, we only care about inspecting the
innermost
- while hasattr(real_func, '__wrapped__'):
- real_func = get_real_func(real_func.__wrapped__)
-
- if 'super' not in real_func.__code__.co_names:
- errors[parent].append(name)
-
- if errors:
- raise pytest.UsageError(*[
- error_msg(p, names) for p, names in errors.items()
- ])
-
-
-def get_real_func(func):
- """
- Copied from patchy.
-
- Duplicates some of the logic implicit in inspect.getsource(). Basically
- some function-esque things, such as classmethods, aren't functions but we
- can peel back the layers to the underlying function very easily.
- """
- if inspect.ismethod(func):
- return func.__func__
- else:
- return func
-
-
-def error_msg(parent, names):
- return '{parent_id} does not call super() in {names}'.format(
- parent_id=parent.nodeid,
- names=', '.join(names),
- )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/setup.cfg
new/pytest-super-check-2.1.0/setup.cfg
--- old/pytest-super-check-2.0.0/setup.cfg 2019-02-28 07:14:23.000000000
+0100
+++ new/pytest-super-check-2.1.0/setup.cfg 2019-12-20 00:00:01.000000000
+0100
@@ -1,16 +1,59 @@
+[metadata]
+name = pytest-super-check
+version = 2.1.0
+description = Pytest plugin to check your TestCase classes call super in
setUp, tearDown, etc.
+long_description = file: README.rst, HISTORY.rst
+long_description_content_type = text/x-rst
+author = Adam Johnson
+author_email = [email protected]
+url = https://github.com/adamchainz/pytest-super-check
+project_urls =
+ Changelog =
https://github.com/adamchainz/pytest-super-check/blob/master/HISTORY.rst
+license = BSD
+keywords = pytest, super, unittest, testcase
+classifiers =
+ Development Status :: 5 - Production/Stable
+ Framework :: Pytest
+ Intended Audience :: Developers
+ License :: OSI Approved :: BSD License
+ Natural Language :: English
+ Programming Language :: Python :: 3 :: Only
+ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.5
+ Programming Language :: Python :: 3.6
+ Programming Language :: Python :: 3.7
+ Programming Language :: Python :: 3.8
+license_file = LICENSE
+
+[options]
+package_dir =
+ =src
+py_modules = pytest_super_check
+include_package_data = True
+install_requires = pytest
+python_requires = >=3.5
+zip_safe = False
+
+[options.entry_points]
+pytest11 =
+ super_check = pytest_super_check
+
[flake8]
-max-line-length = 120
+max-line-length = 80
+select = C,E,F,W,B,B950
+ignore = E203,E501,W503
[isort]
-multi_line_output = 5
-not_skip = __init__.py
-
-[metadata]
-license_file = LICENSE
+include_trailing_comma = True
+force_grid_wrap = 0
+line_length = 88
+multi_line_output = 3
+use_parentheses = True
[tool:multilint]
-paths = pytest_super_check.py
+paths =
setup.py
+ src
tests
[egg_info]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/setup.py
new/pytest-super-check-2.1.0/setup.py
--- old/pytest-super-check-2.0.0/setup.py 2019-02-28 07:13:35.000000000
+0100
+++ new/pytest-super-check-2.1.0/setup.py 2019-10-20 23:11:06.000000000
+0200
@@ -1,52 +1,3 @@
-import re
-
from setuptools import setup
-
-def get_version(filename):
- with open(filename, 'r') as fp:
- contents = fp.read()
- return re.search(r"__version__ = ['\"]([^'\"]+)['\"]", contents).group(1)
-
-
-version = get_version('pytest_super_check.py')
-
-with open('README.rst', 'r') as readme_file:
- readme = readme_file.read()
-
-with open('HISTORY.rst', 'r') as history_file:
- history = history_file.read().replace('.. :changelog:', '')
-
-
-setup(
- name='pytest-super-check',
- version=version,
- description='Pytest plugin to check your TestCase classes call super in
setUp, tearDown, etc.',
- long_description=readme + '\n\n' + history,
- author="Adam Johnson",
- author_email='[email protected]',
- url='https://github.com/adamchainz/pytest-super-check',
- py_modules=['pytest_super_check'],
- include_package_data=True,
- install_requires=[
- 'pytest',
- ],
- python_requires='>=3.4',
- license="BSD",
- zip_safe=False,
- keywords='pytest, super, unittest, testcase',
- entry_points={
- 'pytest11': ['super_check = pytest_super_check'],
- },
- classifiers=[
- 'Development Status :: 5 - Production/Stable',
- 'Framework :: Pytest',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: BSD License',
- 'Natural Language :: English',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- ],
-)
+setup()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/PKG-INFO
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/PKG-INFO
--- old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/PKG-INFO
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/PKG-INFO
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1,107 @@
+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: [email protected]
+License: BSD
+Project-URL: Changelog,
https://github.com/adamchainz/pytest-super-check/blob/master/HISTORY.rst
+Description: ==================
+ 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
+
+Keywords: pytest,super,unittest,testcase
+Platform: UNKNOWN
+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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/SOURCES.txt
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/SOURCES.txt
--- old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/SOURCES.txt
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/SOURCES.txt
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1,15 @@
+HISTORY.rst
+LICENSE
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+src/pytest_super_check.py
+src/pytest_super_check.egg-info/PKG-INFO
+src/pytest_super_check.egg-info/SOURCES.txt
+src/pytest_super_check.egg-info/dependency_links.txt
+src/pytest_super_check.egg-info/entry_points.txt
+src/pytest_super_check.egg-info/not-zip-safe
+src/pytest_super_check.egg-info/requires.txt
+src/pytest_super_check.egg-info/top_level.txt
+tests/test_pytest_super_check.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/dependency_links.txt
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/dependency_links.txt
---
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/dependency_links.txt
1970-01-01 01:00:00.000000000 +0100
+++
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/dependency_links.txt
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1 @@
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/entry_points.txt
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/entry_points.txt
---
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/entry_points.txt
1970-01-01 01:00:00.000000000 +0100
+++
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/entry_points.txt
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1,3 @@
+[pytest11]
+super_check = pytest_super_check
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/not-zip-safe
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/not-zip-safe
--- old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/not-zip-safe
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/not-zip-safe
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1 @@
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/requires.txt
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/requires.txt
--- old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/requires.txt
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/requires.txt
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1 @@
+pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/top_level.txt
new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/top_level.txt
--- old/pytest-super-check-2.0.0/src/pytest_super_check.egg-info/top_level.txt
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.egg-info/top_level.txt
2019-12-20 00:00:00.000000000 +0100
@@ -0,0 +1 @@
+pytest_super_check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/src/pytest_super_check.py
new/pytest-super-check-2.1.0/src/pytest_super_check.py
--- old/pytest-super-check-2.0.0/src/pytest_super_check.py 1970-01-01
01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/src/pytest_super_check.py 2019-10-21
11:29:01.000000000 +0200
@@ -0,0 +1,63 @@
+import inspect
+from collections import defaultdict
+
+import pytest
+from _pytest.unittest import UnitTestCase
+
+
+def pytest_collection_modifyitems(session, config, items):
+ errors = defaultdict(list)
+
+ for item in items:
+ parent = getattr(item, "parent", None)
+ if parent is None or not isinstance(parent, UnitTestCase) or parent in
errors:
+ continue
+
+ klass = parent.cls
+
+ for name in (
+ "setUpClass",
+ "setUpTestData",
+ "setUp",
+ "tearDown",
+ "tearDownClass",
+ ):
+ try:
+ klass.__dict__[name]
+ except KeyError:
+ # Not defined in this class (may be in superclass)
+ continue
+
+ func = getattr(klass, name) # Fetch *bound* method
+
+ real_func = get_real_func(func)
+
+ # Unwrap any decorators, we only care about inspecting the
innermost
+ while hasattr(real_func, "__wrapped__"):
+ real_func = get_real_func(real_func.__wrapped__)
+
+ if "super" not in real_func.__code__.co_names:
+ errors[parent].append(name)
+
+ if errors:
+ raise pytest.UsageError(*[error_msg(p, names) for p, names in
errors.items()])
+
+
+def get_real_func(func):
+ """
+ Copied from patchy.
+
+ Duplicates some of the logic implicit in inspect.getsource(). Basically
+ some function-esque things, such as classmethods, aren't functions but we
+ can peel back the layers to the underlying function very easily.
+ """
+ if inspect.ismethod(func):
+ return func.__func__
+ else:
+ return func
+
+
+def error_msg(parent, names):
+ return "{parent_id} does not call super() in {names}".format(
+ parent_id=parent.nodeid, names=", ".join(names)
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-super-check-2.0.0/tests/test_it.py
new/pytest-super-check-2.1.0/tests/test_it.py
--- old/pytest-super-check-2.0.0/tests/test_it.py 2019-02-28
07:13:35.000000000 +0100
+++ new/pytest-super-check-2.1.0/tests/test_it.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,240 +0,0 @@
-pytest_plugins = ['pytester']
-
-
-def test_it_does_not_complain_when_everything_supers_correctly(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- @classmethod
- def setUpClass(cls):
- super(MyTests, cls).setUpClass()
-
- @classmethod
- def setUpTestData(cls):
- super(MyTests, cls).setUpTestData()
-
- def setUp(self):
- super(MyTests, self).setUp()
-
- def test_one(self):
- pass
-
- def tearDown(self):
- super(MyTests, self).tearDown()
-
- @classmethod
- def tearDownClass(cls):
- super(MyTests, cls).tearDownClass()
- """
- )
- out = testdir.runpytest()
- out.assert_outcomes(passed=1, failed=0)
-
-
-def test_it_complains_when_a_case_does_not_super_in_setUp(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- def setUp(self):
- self.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in setUp'
- ])
-
-
-def test_it_complains_when_a_case_does_not_super_in_tearDown(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- def tearDown(self):
- self.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in tearDown'
- ])
-
-
-def test_it_complains_when_a_case_does_not_super_in_setUpClass(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- @classmethod
- def setUpClass(cls):
- cls.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in setUpClass'
- ])
-
-
-def test_it_complains_when_a_case_does_not_super_in_setUpTestData(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
- class TestData(object): # Fake for Django test case
- @classmethod
- def setUpTestData(cls):
- pass
-
-
- class MyTests(TestData, TestCase):
-
- @classmethod
- def setUpTestData(cls):
- cls.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in setUpTestData'
- ])
-
-
-def test_it_complains_when_a_case_does_not_super_in_tearDownClass(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- @classmethod
- def tearDownClass(cls):
- cls.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in tearDownClass'
- ])
-
-
-def
test_it_complains_when_a_case_does_not_super_in_setUp_and_setUpClass(testdir):
- testdir.makepyfile(
- test_one="""
- from unittest import TestCase
-
-
- class MyTests(TestCase):
-
- @classmethod
- def setUpClass(cls):
- cls.x = 1
-
- def setUp(self):
- self.y = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in setUpClass,
setUp'
- ])
-
-
-def
test_it_does_not_complain_when_a_decorator_is_used_but_super_is_called(testdir):
- testdir.makepyfile(
- test_one="""
- from functools import wraps
- from unittest import TestCase
-
-
- def mydecorator(func):
- @wraps(func)
- def wrapper(self):
- return func(self)
- wrapper.__wrapped__ = func # Python 2.7 compat
- return wrapper
-
-
- class MyTests(TestCase):
-
- @mydecorator
- def setUp(self):
- super(MyTests, self).setUp()
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- out.assert_outcomes(passed=1, failed=0)
-
-
-def
test_it_complains_when_a_decorator_is_used_and_super_is_not_called(testdir):
- testdir.makepyfile(
- test_one="""
- from functools import wraps
- from unittest import TestCase
-
-
- def mydecorator(func):
- @wraps(func)
- def wrapper(self):
- return func(self)
- wrapper.__wrapped__ = func # Python 2.7 compat
- return wrapper
-
-
- class MyTests(TestCase):
-
- @mydecorator
- def setUp(self):
- self.x = 1
-
- def test_one(self):
- pass
- """
- )
- out = testdir.runpytest()
- assert out.ret > 0
- out.stderr.fnmatch_lines([
- 'ERROR: test_one.py::MyTests does not call super() in setUp'
- ])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-super-check-2.0.0/tests/test_pytest_super_check.py
new/pytest-super-check-2.1.0/tests/test_pytest_super_check.py
--- old/pytest-super-check-2.0.0/tests/test_pytest_super_check.py
1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-super-check-2.1.0/tests/test_pytest_super_check.py
2019-10-21 11:29:01.000000000 +0200
@@ -0,0 +1,240 @@
+pytest_plugins = ["pytester"]
+
+
+def test_it_does_not_complain_when_everything_supers_correctly(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(MyTests, cls).setUpClass()
+
+ @classmethod
+ def setUpTestData(cls):
+ super(MyTests, cls).setUpTestData()
+
+ def setUp(self):
+ super(MyTests, self).setUp()
+
+ def test_one(self):
+ pass
+
+ def tearDown(self):
+ super(MyTests, self).tearDown()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(MyTests, cls).tearDownClass()
+ """
+ )
+ out = testdir.runpytest()
+ out.assert_outcomes(passed=1, failed=0)
+
+
+def test_it_complains_when_a_case_does_not_super_in_setUp(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ def setUp(self):
+ self.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in setUp"]
+ )
+
+
+def test_it_complains_when_a_case_does_not_super_in_tearDown(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ def tearDown(self):
+ self.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in tearDown"]
+ )
+
+
+def test_it_complains_when_a_case_does_not_super_in_setUpClass(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in setUpClass"]
+ )
+
+
+def test_it_complains_when_a_case_does_not_super_in_setUpTestData(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+ class TestData(object): # Fake for Django test case
+ @classmethod
+ def setUpTestData(cls):
+ pass
+
+
+ class MyTests(TestData, TestCase):
+
+ @classmethod
+ def setUpTestData(cls):
+ cls.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in setUpTestData"]
+ )
+
+
+def test_it_complains_when_a_case_does_not_super_in_tearDownClass(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in tearDownClass"]
+ )
+
+
+def
test_it_complains_when_a_case_does_not_super_in_setUp_and_setUpClass(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from unittest import TestCase
+
+
+ class MyTests(TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.x = 1
+
+ def setUp(self):
+ self.y = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in setUpClass,
setUp"]
+ )
+
+
+def
test_it_does_not_complain_when_a_decorator_is_used_but_super_is_called(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from functools import wraps
+ from unittest import TestCase
+
+
+ def mydecorator(func):
+ @wraps(func)
+ def wrapper(self):
+ return func(self)
+ wrapper.__wrapped__ = func # Python 2.7 compat
+ return wrapper
+
+
+ class MyTests(TestCase):
+
+ @mydecorator
+ def setUp(self):
+ super(MyTests, self).setUp()
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ out.assert_outcomes(passed=1, failed=0)
+
+
+def
test_it_complains_when_a_decorator_is_used_and_super_is_not_called(testdir):
+ testdir.makepyfile(
+ test_one="""
+ from functools import wraps
+ from unittest import TestCase
+
+
+ def mydecorator(func):
+ @wraps(func)
+ def wrapper(self):
+ return func(self)
+ wrapper.__wrapped__ = func # Python 2.7 compat
+ return wrapper
+
+
+ class MyTests(TestCase):
+
+ @mydecorator
+ def setUp(self):
+ self.x = 1
+
+ def test_one(self):
+ pass
+ """
+ )
+ out = testdir.runpytest()
+ assert out.ret > 0
+ out.stderr.fnmatch_lines(
+ ["ERROR: test_one.py::MyTests does not call super() in setUp"]
+ )