Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}
31 changes: 4 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: build

on: [push, pull_request]
on:
push:
branches:
pull_request:

jobs:
build:
Expand Down Expand Up @@ -80,29 +83,3 @@ jobs:
- 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 }}
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

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

Expand Down
22 changes: 14 additions & 8 deletions pytest_subtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def _addSubTest(self, test_case, test, exc_info):
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)
Expand Down Expand Up @@ -189,13 +193,15 @@ def test(self, msg=None, **kwargs):


def make_call_info(exc_info, *, start, stop, duration, when):
try:
return CallInfo(
None, exc_info, start=start, stop=stop, duration=duration, when=when
)
except TypeError:
# support for pytest<6: didn't have a duration parameter then
return CallInfo(None, exc_info, start=start, stop=stop, when=when)
return CallInfo(
None,
exc_info,
start=start,
stop=stop,
duration=duration,
when=when,
_ispytest=True,
)


@contextmanager
Expand Down
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,12 +16,12 @@ def read(fname):
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.6",
install_requires=["pytest>=6.0"],
install_requires=["pytest>=7.0"],
classifiers=[
"Development Status :: 4 - Beta",
"Framework :: Pytest",
Expand Down