Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pytest-subtests for openSUSE:Factory checked in at 2023-01-11 14:32:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-subtests (Old) and /work/SRC/openSUSE:Factory/.python-pytest-subtests.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-subtests" Wed Jan 11 14:32:56 2023 rev:7 rq:1057181 version:0.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-subtests/python-pytest-subtests.changes 2021-10-08 00:07:08.657864577 +0200 +++ /work/SRC/openSUSE:Factory/.python-pytest-subtests.new.32243/python-pytest-subtests.changes 2023-01-11 14:32:57.960523686 +0100 @@ -1,0 +2,17 @@ +Tue Jan 10 04:19:50 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Update to 0.9.0: + * Python 3.11 is officially supported. + * Dropped support for Python 3.6. + * Now passing subtests are shown in the test run summary at the end (for + example: 10 failed, 1 passed, 10 subtests passed in 0.10s) (#70). + * Fixed support for pytest 7.0, and pytest>=7.0 is now required. + * pytest>=6.0 is now required. + * Added official support for Python 3.10. + * Dropped support for Python 3.5. + * Users no longer need to configure a warnings filter for the internal A + private pytest class or function was used pytest warning (#52). + * Experimental: Use SUBPASS and , for passed subtests instead of general + PASSED, SUBFAIL and u for failed ones instead of FAILED (#30). + +------------------------------------------------------------------- Old: ---- pytest-subtests-0.5.0.tar.gz New: ---- pytest-subtests-0.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-subtests.spec ++++++ --- /var/tmp/diff_new_pack.Wx0IiI/_old 2023-01-11 14:32:59.504532256 +0100 +++ /var/tmp/diff_new_pack.Wx0IiI/_new 2023-01-11 14:32:59.504532256 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pytest-subtests # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,8 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 Name: python-pytest-subtests -Version: 0.5.0 +Version: 0.9.0 Release: 0 Summary: Python unittest subTest() support and subtests fixture License: MIT @@ -29,10 +27,10 @@ BuildRequires: %{python_module setuptools_scm} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-pytest >= 5.3.0 +Requires: python-pytest >= 7.0 BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module pytest >= 5.3.0} +BuildRequires: %{python_module pytest >= 7.0} # /SECTION %python_subpackages ++++++ pytest-subtests-0.5.0.tar.gz -> pytest-subtests-0.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/.github/workflows/deploy.yml new/pytest-subtests-0.9.0/.github/workflows/deploy.yml --- old/pytest-subtests-0.5.0/.github/workflows/deploy.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest-subtests-0.9.0/.github/workflows/deploy.yml 2022-10-28 18:27:21.000000000 +0200 @@ -0,0 +1,30 @@ +name: deploy + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + deploy: + if: github.repository == 'pytest-dev/pytest-subtests' + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: "3.9" + - name: Install dependencies + run: | + python -m pip install --upgrade pip build + - name: Build package + run: | + python -m build + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_token }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/.github/workflows/main.yml new/pytest-subtests-0.9.0/.github/workflows/main.yml --- old/pytest-subtests-0.5.0/.github/workflows/main.yml 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/.github/workflows/main.yml 2022-10-28 18:27:21.000000000 +0200 @@ -1,6 +1,9 @@ name: build -on: [push, pull_request] +on: + push: + branches: + pull_request: jobs: build: @@ -11,30 +14,20 @@ fail-fast: false matrix: name: [ - "windows-py35", - "windows-py36", "windows-py37", "windows-py38", "windows-py39", - "windows-py38-pytest53", + "windows-py310", + "windows-py311", - "ubuntu-py35", - "ubuntu-py36", "ubuntu-py37", "ubuntu-py38", "ubuntu-py39", - "ubuntu-py38-pytest53", + "ubuntu-py310", + "ubuntu-py311", ] include: - - name: "windows-py35" - python: "3.5" - os: windows-latest - tox_env: "py35" - - name: "windows-py36" - python: "3.6" - os: windows-latest - tox_env: "py36" - name: "windows-py37" python: "3.7" os: windows-latest @@ -47,23 +40,15 @@ python: "3.9" os: windows-latest tox_env: "py39" - - name: "windows-py38-pytest53" - python: "3.8" + - name: "windows-py310" + python: "3.10" os: windows-latest - tox_env: "py38-pytest53" - - name: "windows-py38-pytest54" - python: "3.8" + tox_env: "py310" + - name: "windows-py311" + python: "3.11-dev" os: windows-latest - tox_env: "py38-pytest54" + tox_env: "py311" - - name: "ubuntu-py35" - python: "3.5" - os: ubuntu-latest - tox_env: "py35" - - name: "ubuntu-py36" - python: "3.6" - os: ubuntu-latest - tox_env: "py36" - name: "ubuntu-py37" python: "3.7" os: ubuntu-latest @@ -76,19 +61,19 @@ python: "3.9" os: ubuntu-latest tox_env: "py39" - - name: "ubuntu-py38-pytest53" - python: "3.8" + - name: "ubuntu-py310" + python: "3.10" os: ubuntu-latest - tox_env: "py38-pytest53" - - name: "ubuntu-py38-pytest54" - python: "3.8" + tox_env: "py310" + - name: "ubuntu-py311" + python: "3.11-dev" os: ubuntu-latest - tox_env: "py38-pytest54" + tox_env: "py311" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - name: Install tox @@ -98,29 +83,3 @@ - name: Test run: | tox -e ${{ matrix.tox_env }} - - deploy: - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - - runs-on: ubuntu-latest - - needs: [build] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.7" - - name: Install wheel - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade wheel setuptools - - name: Build package - run: | - python setup.py sdist bdist_wheel - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_token }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/.pre-commit-config.yaml new/pytest-subtests-0.9.0/.pre-commit-config.yaml --- old/pytest-subtests-0.5.0/.pre-commit-config.yaml 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/.pre-commit-config.yaml 2022-10-28 18:27:21.000000000 +0200 @@ -1,18 +1,18 @@ repos: -- repo: https://github.com/ambv/black - rev: 19.10b0 +- repo: https://github.com/psf/black + rev: 22.3.0 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.2.3 + rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: debug-statements - repo: https://github.com/asottile/reorder_python_imports - rev: v1.4.0 + rev: v3.1.0 hooks: - id: reorder-python-imports - repo: local @@ -20,6 +20,6 @@ - id: rst name: rst entry: rst-lint --encoding utf-8 - files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst)$ + files: ^(CHANGELOG.rst|RELEASING.rst|README.rst)$ language: python additional_dependencies: [pygments, restructuredtext_lint] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/CHANGELOG.rst new/pytest-subtests-0.9.0/CHANGELOG.rst --- old/pytest-subtests-0.5.0/CHANGELOG.rst 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/CHANGELOG.rst 2022-10-28 18:27:21.000000000 +0200 @@ -1,29 +1,61 @@ CHANGELOG ========= +0.9.0 (2022-10-28) +------------------ + +* Python 3.11 is officially supported. +* Dropped support for Python 3.6. + +0.8.0 (2022-05-26) +------------------ + +* Now passing subtests are shown in the test run summary at the end (for example: ``10 failed, 1 passed, 10 subtests passed in 0.10s``) (`#70`_). + +.. _#70: https://github.com/pytest-dev/pytest-subtests/pull/70 + +0.7.0 (2022-02-13) +------------------ + +* Fixed support for pytest 7.0, and ``pytest>=7.0`` is now required. + + +0.6.0 (2022-01-15) +------------------ + +* ``pytest>=6.0`` is now required. +* Added official support for Python 3.10. +* Dropped support for Python 3.5. +* Users no longer need to configure a warnings filter for the internal ``A private pytest class or function was used`` pytest warning (`#52`_). +* **Experimental**: Use ``SUBPASS`` and ``,`` for passed subtests instead of general ``PASSED``, + ``SUBFAIL`` and ``u`` for failed ones instead of ``FAILED`` (`#30`_). + +.. _#30: https://github.com/pytest-dev/pytest-subtests/pull/30 +.. _#52: https://github.com/pytest-dev/pytest-subtests/pull/52 + 0.5.0 (2021-05-29) ------------------ -* Add support for ``pytest.mark.xfail`` (`#40`_). +* Added support for ``pytest.mark.xfail`` (`#40`_). .. _#40: https://github.com/pytest-dev/pytest-subtests/pull/40 0.4.0 (2020-12-13) ------------------ -* Add support for ``--pdb`` (`#22`_). +* Added support for ``--pdb`` (`#22`_). .. _#22: https://github.com/pytest-dev/pytest-subtests/issues/22 0.3.2 (2020-08-01) ------------------ -* Fix pytest 6.0 support. +* Fixed pytest 6.0 support. 0.3.1 (2020-05-20) ------------------ -* Fix pytest 5.4 support. +* Fixed pytest 5.4 support. 0.3.0 (2020-01-22) ------------------ @@ -36,7 +68,7 @@ 0.2.1 (2019-04-04) ------------------ -* Fix verbose output reporting on Linux (`#7`_). +* Fixed verbose output reporting on Linux (`#7`_). .. _#7: https://github.com/pytest-dev/pytest-subtests/issues/7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/PKG-INFO new/pytest-subtests-0.9.0/PKG-INFO --- old/pytest-subtests-0.5.0/PKG-INFO 2021-05-29 15:08:20.000000000 +0200 +++ new/pytest-subtests-0.9.0/PKG-INFO 2022-10-28 18:27:31.337328700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest-subtests -Version: 0.5.0 +Version: 0.9.0 Summary: unittest subTest() support and subtests fixture Home-page: https://github.com/pytest-dev/pytest-subtests Author: Bruno Oliveira @@ -8,22 +8,21 @@ Maintainer: Bruno Oliveira Maintainer-email: nicodde...@gmail.com License: MIT -Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Framework :: Pytest Classifier: Intended Audience :: Developers Classifier: Topic :: Software Development :: Testing Classifier: Programming Language :: Python 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 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: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License -Requires-Python: >=3.5 +Requires-Python: >=3.7 License-File: LICENSE =============== @@ -62,27 +61,6 @@ * New ``subtests`` fixture, providing similar functionality for pure pytest tests. -Requirements ------------- - -* ``Python`` >= 3.5. -* ``pytest`` >= 5.3. - -pytest 6.2+ -^^^^^^^^^^^ - -``pytest 6.2`` now issues a warning when internal classes are used by third-party code, -which is the case for ``pytest-subtests`` which needs to use some internal classes -to integrate with other pytest features (such as capturing and debugging). - -For now users can ignore those warnings by adding this to their configuration file: - -.. code-block:: ini - - [pytest] - filterwarnings = - ignore:A private pytest class or function was used.:PytestDeprecationWarning - Installation ------------ @@ -200,7 +178,7 @@ .. code-block:: - tox -e py37,linting + tox -e py37 License ------- @@ -225,5 +203,3 @@ .. _`tox`: https://tox.readthedocs.io/en/latest/ .. _`pip`: https://pypi.org/project/pip/ .. _`PyPI`: https://pypi.org/project - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/README.rst new/pytest-subtests-0.9.0/README.rst --- old/pytest-subtests-0.5.0/README.rst 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/README.rst 2022-10-28 18:27:21.000000000 +0200 @@ -34,27 +34,6 @@ * New ``subtests`` fixture, providing similar functionality for pure pytest tests. -Requirements ------------- - -* ``Python`` >= 3.5. -* ``pytest`` >= 5.3. - -pytest 6.2+ -^^^^^^^^^^^ - -``pytest 6.2`` now issues a warning when internal classes are used by third-party code, -which is the case for ``pytest-subtests`` which needs to use some internal classes -to integrate with other pytest features (such as capturing and debugging). - -For now users can ignore those warnings by adding this to their configuration file: - -.. code-block:: ini - - [pytest] - filterwarnings = - ignore:A private pytest class or function was used.:PytestDeprecationWarning - Installation ------------ @@ -172,7 +151,7 @@ .. code-block:: - tox -e py37,linting + tox -e py37 License ------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/pytest_subtests.egg-info/PKG-INFO new/pytest-subtests-0.9.0/pytest_subtests.egg-info/PKG-INFO --- old/pytest-subtests-0.5.0/pytest_subtests.egg-info/PKG-INFO 2021-05-29 15:08:20.000000000 +0200 +++ new/pytest-subtests-0.9.0/pytest_subtests.egg-info/PKG-INFO 2022-10-28 18:27:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest-subtests -Version: 0.5.0 +Version: 0.9.0 Summary: unittest subTest() support and subtests fixture Home-page: https://github.com/pytest-dev/pytest-subtests Author: Bruno Oliveira @@ -8,22 +8,21 @@ Maintainer: Bruno Oliveira Maintainer-email: nicodde...@gmail.com License: MIT -Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Framework :: Pytest Classifier: Intended Audience :: Developers Classifier: Topic :: Software Development :: Testing Classifier: Programming Language :: Python 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 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: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License -Requires-Python: >=3.5 +Requires-Python: >=3.7 License-File: LICENSE =============== @@ -62,27 +61,6 @@ * New ``subtests`` fixture, providing similar functionality for pure pytest tests. -Requirements ------------- - -* ``Python`` >= 3.5. -* ``pytest`` >= 5.3. - -pytest 6.2+ -^^^^^^^^^^^ - -``pytest 6.2`` now issues a warning when internal classes are used by third-party code, -which is the case for ``pytest-subtests`` which needs to use some internal classes -to integrate with other pytest features (such as capturing and debugging). - -For now users can ignore those warnings by adding this to their configuration file: - -.. code-block:: ini - - [pytest] - filterwarnings = - ignore:A private pytest class or function was used.:PytestDeprecationWarning - Installation ------------ @@ -200,7 +178,7 @@ .. code-block:: - tox -e py37,linting + tox -e py37 License ------- @@ -225,5 +203,3 @@ .. _`tox`: https://tox.readthedocs.io/en/latest/ .. _`pip`: https://pypi.org/project/pip/ .. _`PyPI`: https://pypi.org/project - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/pytest_subtests.egg-info/SOURCES.txt new/pytest-subtests-0.9.0/pytest_subtests.egg-info/SOURCES.txt --- old/pytest-subtests-0.5.0/pytest_subtests.egg-info/SOURCES.txt 2021-05-29 15:08:20.000000000 +0200 +++ new/pytest-subtests-0.9.0/pytest_subtests.egg-info/SOURCES.txt 2022-10-28 18:27:31.000000000 +0200 @@ -7,6 +7,7 @@ pytest_subtests.py setup.py tox.ini +.github/workflows/deploy.yml .github/workflows/main.yml pytest_subtests.egg-info/PKG-INFO pytest_subtests.egg-info/SOURCES.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/pytest_subtests.egg-info/entry_points.txt new/pytest-subtests-0.9.0/pytest_subtests.egg-info/entry_points.txt --- old/pytest-subtests-0.5.0/pytest_subtests.egg-info/entry_points.txt 2021-05-29 15:08:20.000000000 +0200 +++ new/pytest-subtests-0.9.0/pytest_subtests.egg-info/entry_points.txt 2022-10-28 18:27:31.000000000 +0200 @@ -1,3 +1,2 @@ [pytest11] subtests = pytest_subtests - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/pytest_subtests.egg-info/requires.txt new/pytest-subtests-0.9.0/pytest_subtests.egg-info/requires.txt --- old/pytest-subtests-0.5.0/pytest_subtests.egg-info/requires.txt 2021-05-29 15:08:20.000000000 +0200 +++ new/pytest-subtests-0.9.0/pytest_subtests.egg-info/requires.txt 2022-10-28 18:27:31.000000000 +0200 @@ -1 +1 @@ -pytest>=5.3.0 +pytest>=7.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/pytest_subtests.py new/pytest-subtests-0.9.0/pytest_subtests.py --- old/pytest-subtests-0.5.0/pytest_subtests.py 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/pytest_subtests.py 2022-10-28 18:27:21.000000000 +0200 @@ -1,6 +1,6 @@ -import sys import time from contextlib import contextmanager +from contextlib import nullcontext import attr import pytest @@ -14,19 +14,9 @@ from _pytest.runner import check_interactive_exception from _pytest.unittest import TestCaseFunction -if sys.version_info[:2] < (3, 7): - - @contextmanager - def nullcontext(): - yield - - -else: - from contextlib import nullcontext - @attr.s -class SubTestContext(object): +class SubTestContext: msg = attr.ib() kwargs = attr.ib() @@ -36,23 +26,19 @@ context = attr.ib() @property - def count_towards_summary(self): - return not self.passed - - @property def head_line(self): _, _, domain = self.location - return "{} {}".format(domain, self.sub_test_description()) + return f"{domain} {self.sub_test_description()}" def sub_test_description(self): parts = [] if isinstance(self.context.msg, str): - parts.append("[{}]".format(self.context.msg)) + parts.append(f"[{self.context.msg}]") if self.context.kwargs: params_desc = ", ".join( - "{}={!r}".format(k, v) for (k, v) in sorted(self.context.kwargs.items()) + f"{k}={v!r}" for (k, v) in sorted(self.context.kwargs.items()) ) - parts.append("({})".format(params_desc)) + parts.append(f"({params_desc})") return " ".join(parts) or "(<subtest>)" def _to_json(self): @@ -80,7 +66,11 @@ if exc_info is not None: msg = test._message if isinstance(test._message, str) else None call_info = make_call_info( - ExceptionInfo(exc_info), start=0, stop=0, duration=0, when="call" + ExceptionInfo(exc_info, _ispytest=True), + start=0, + stop=0, + duration=0, + when="call", ) report = self.ihook.pytest_runtest_makereport(item=self, call=call_info) sub_report = SubTestReport._from_test_report(report) @@ -115,7 +105,7 @@ @attr.s -class SubTests(object): +class SubTests: ihook = attr.ib() suspend_capture_ctx = attr.ib() request = attr.ib() @@ -130,17 +120,15 @@ # capsys or capfd are active, subtest should not capture - # pytest<5.4 support: node holds the active fixture - capture_fixture_active = getattr(self.request.node, "_capture_fixture", None) - if capture_fixture_active is None: - # pytest>=5.4 support: capture manager plugin holds the active fixture - capman = self.request.config.pluginmanager.getplugin("capturemanager") - capture_fixture_active = getattr(capman, "_capture_fixture", None) + capman = self.request.config.pluginmanager.getplugin("capturemanager") + capture_fixture_active = getattr(capman, "_capture_fixture", None) if option == "sys" and not capture_fixture_active: - fixture = CaptureFixture(SysCapture, self.request) + with ignore_pytest_private_warning(): + fixture = CaptureFixture(SysCapture, self.request) elif option == "fd" and not capture_fixture_active: - fixture = CaptureFixture(FDCapture, self.request) + with ignore_pytest_private_warning(): + fixture = CaptureFixture(FDCapture, self.request) else: fixture = None @@ -192,13 +180,28 @@ def make_call_info(exc_info, *, start, stop, duration, when): - try: - return CallInfo( - None, exc_info, start=start, stop=stop, duration=duration, when=when + return CallInfo( + None, + exc_info, + start=start, + stop=stop, + duration=duration, + when=when, + _ispytest=True, + ) + + +@contextmanager +def ignore_pytest_private_warning(): + import warnings + + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + "A private pytest class or function was used.", + category=pytest.PytestDeprecationWarning, ) - except TypeError: - # support for pytest<6: didn't have a duration parameter then - return CallInfo(None, exc_info, start=start, stop=stop, when=when) + yield @attr.s @@ -221,3 +224,20 @@ def pytest_report_from_serializable(data): if data.get("_report_type") == "SubTestReport": return SubTestReport._from_json(data) + + +@pytest.hookimpl(tryfirst=True) +def pytest_report_teststatus(report): + if report.when != "call" or not isinstance(report, SubTestReport): + return + + if hasattr(report, "wasxfail"): + return None + + outcome = report.outcome + if report.passed: + return f"subtests {outcome}", ",", "SUBPASS" + elif report.skipped: + return outcome, "-", "SUBSKIP" + elif outcome == "failed": + return outcome, "u", "SUBFAIL" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/setup.py new/pytest-subtests-0.9.0/setup.py --- old/pytest-subtests-0.5.0/setup.py 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/setup.py 2022-10-28 18:27:21.000000000 +0200 @@ -1,13 +1,11 @@ -import codecs -import os +from pathlib import Path from setuptools import setup -def read(fname): - file_path = os.path.join(os.path.dirname(__file__), fname) - return codecs.open(file_path, encoding="utf-8").read() - +long_description = ( + Path(__file__).parent.joinpath("README.rst").read_text(encoding="UTF-8") +) setup( name="pytest-subtests", @@ -18,12 +16,12 @@ license="MIT", url="https://github.com/pytest-dev/pytest-subtests", description="unittest subTest() support and subtests fixture", - long_description=read("README.rst"), + long_description=long_description, py_modules=["pytest_subtests"], use_scm_version=True, setup_requires=["setuptools-scm", "setuptools>=40.0"], - python_requires=">=3.5", - install_requires=["pytest>=5.3.0"], + python_requires=">=3.7", + install_requires=["pytest>=7.0"], classifiers=[ "Development Status :: 4 - Beta", "Framework :: Pytest", @@ -31,11 +29,11 @@ "Topic :: Software Development :: Testing", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/tests/test_subtests.py new/pytest-subtests-0.9.0/tests/test_subtests.py --- old/pytest-subtests-0.5.0/tests/test_subtests.py 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/tests/test_subtests.py 2022-10-28 18:27:21.000000000 +0200 @@ -2,19 +2,7 @@ import pytest - -@pytest.fixture(autouse=True) -def ignore_private_class_warning(testdir): - """ - Make every test in this file ignore the warning about using private pytest classes; - It is a risk we are willing to take in this plugin. - """ - testdir.makeini( - """ - [pytest] - filterwarnings = ignore:A private pytest class - """ - ) +IS_PY311 = sys.version_info[:2] >= (3, 11) @pytest.mark.parametrize("mode", ["normal", "xdist"]) @@ -46,7 +34,7 @@ expected_lines += [ "* test_foo [[]custom[]] (i=1) *", "* test_foo [[]custom[]] (i=3) *", - "* 2 failed, 1 passed in *", + "* 2 failed, 1 passed, 3 subtests passed in *", ] result.stdout.fnmatch_lines(expected_lines) @@ -55,11 +43,11 @@ result = testdir.runpytest("-v") expected_lines = [ "*collected 1 item", - "test_simple_terminal_verbose.py::test_foo PASSED *100%*", - "test_simple_terminal_verbose.py::test_foo FAILED *100%*", - "test_simple_terminal_verbose.py::test_foo PASSED *100%*", - "test_simple_terminal_verbose.py::test_foo FAILED *100%*", - "test_simple_terminal_verbose.py::test_foo PASSED *100%*", + "test_simple_terminal_verbose.py::test_foo SUBPASS *100%*", + "test_simple_terminal_verbose.py::test_foo SUBFAIL *100%*", + "test_simple_terminal_verbose.py::test_foo SUBPASS *100%*", + "test_simple_terminal_verbose.py::test_foo SUBFAIL *100%*", + "test_simple_terminal_verbose.py::test_foo SUBPASS *100%*", "test_simple_terminal_verbose.py::test_foo PASSED *100%*", ] else: @@ -78,7 +66,7 @@ expected_lines += [ "* test_foo [[]custom[]] (i=1) *", "* test_foo [[]custom[]] (i=3) *", - "* 2 failed, 1 passed in *", + "* 2 failed, 1 passed, 3 subtests passed in *", ] result.stdout.fnmatch_lines(expected_lines) @@ -100,7 +88,7 @@ pytest.importorskip("xdist") result = testdir.runpytest("-n1") expected_lines = ["gw0 [1]"] - expected_lines += ["* 1 passed, 3 skipped in *"] + expected_lines += ["* 1 passed, 3 skipped, 2 subtests passed in *"] result.stdout.fnmatch_lines(expected_lines) def test_xfail(self, testdir, mode): @@ -121,7 +109,7 @@ pytest.importorskip("xdist") result = testdir.runpytest("-n1") expected_lines = ["gw0 [1]"] - expected_lines += ["* 1 passed, 3 xfailed in *"] + expected_lines += ["* 1 passed, 3 xfailed, 2 subtests passed in *"] result.stdout.fnmatch_lines(expected_lines) @@ -151,13 +139,14 @@ @pytest.mark.parametrize("runner", ["unittest", "pytest-normal", "pytest-xdist"]) def test_simple_terminal_normal(self, simple_script, testdir, runner): + suffix = ".test_foo" if IS_PY311 else "" if runner == "unittest": result = testdir.run(sys.executable, simple_script) result.stderr.fnmatch_lines( [ - "FAIL: test_foo (__main__.T) [custom] (i=1)", + f"FAIL: test_foo (__main__.T{suffix}) [custom] (i=1)", "AssertionError: 1 != 0", - "FAIL: test_foo (__main__.T) [custom] (i=3)", + f"FAIL: test_foo (__main__.T{suffix}) [custom] (i=3)", "AssertionError: 1 != 0", "Ran 1 test in *", "FAILED (failures=2)", @@ -185,14 +174,15 @@ @pytest.mark.parametrize("runner", ["unittest", "pytest-normal", "pytest-xdist"]) def test_simple_terminal_verbose(self, simple_script, testdir, runner): + suffix = ".test_foo" if IS_PY311 else "" if runner == "unittest": result = testdir.run(sys.executable, simple_script, "-v") result.stderr.fnmatch_lines( [ - "test_foo (__main__.T) ... ", - "FAIL: test_foo (__main__.T) [custom] (i=1)", + f"test_foo (__main__.T{suffix}) ... ", + f"FAIL: test_foo (__main__.T{suffix}) [custom] (i=1)", "AssertionError: 1 != 0", - "FAIL: test_foo (__main__.T) [custom] (i=3)", + f"FAIL: test_foo (__main__.T{suffix}) [custom] (i=3)", "AssertionError: 1 != 0", "Ran 1 test in *", "FAILED (failures=2)", @@ -203,8 +193,8 @@ result = testdir.runpytest(simple_script, "-v") expected_lines = [ "*collected 1 item", - "test_simple_terminal_verbose.py::T::test_foo FAILED *100%*", - "test_simple_terminal_verbose.py::T::test_foo FAILED *100%*", + "test_simple_terminal_verbose.py::T::test_foo SUBFAIL *100%*", + "test_simple_terminal_verbose.py::T::test_foo SUBFAIL *100%*", "test_simple_terminal_verbose.py::T::test_foo PASSED *100%*", ] else: @@ -212,8 +202,8 @@ result = testdir.runpytest(simple_script, "-n1", "-v") expected_lines = [ "gw0 [1]", - "*gw0*100%* FAILED test_simple_terminal_verbose.py::T::test_foo*", - "*gw0*100%* FAILED test_simple_terminal_verbose.py::T::test_foo*", + "*gw0*100%* SUBFAIL test_simple_terminal_verbose.py::T::test_foo*", + "*gw0*100%* SUBFAIL test_simple_terminal_verbose.py::T::test_foo*", "*gw0*100%* PASSED test_simple_terminal_verbose.py::T::test_foo*", ] result.stdout.fnmatch_lines( @@ -338,8 +328,8 @@ [ "start test", "hello stdout A", - "Fhello stdout B", - "Fend test", + "uhello stdout B", + "uend test", "*__ test (i='A') __*", "*__ test (i='B') __*", "*__ test __*", @@ -369,7 +359,9 @@ ) result = testdir.runpytest() result.stdout.fnmatch_lines( - ["*1 passed*",] + [ + "*1 passed*", + ] ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-subtests-0.5.0/tox.ini new/pytest-subtests-0.9.0/tox.ini --- old/pytest-subtests-0.5.0/tox.ini 2021-05-29 15:08:15.000000000 +0200 +++ new/pytest-subtests-0.9.0/tox.ini 2022-10-28 18:27:21.000000000 +0200 @@ -1,15 +1,10 @@ [tox] -envlist = py35,py36,py37,py38,py39,py38-pytest53,py38-pytest54,pypy3,linting +envlist = py37,py38,py39,py310,py311 [testenv] passenv = USER USERNAME TRAVIS PYTEST_ADDOPTS deps = pytest-xdist>=1.28 - pytest53: pytest ==5.3.5 - pytest54: pytest ==5.4.3 commands = pytest {posargs:tests} - -[flake8] -max-line-length = 120