Metadata-Version: 2.1
Name: pytest-smoke
Version: 0.0.2
Summary: pytest plugin for supporting smoke testing
Author-email: Yugo Kato <yugokato.o@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Yugo Kato
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/yugokato/pytest-smoke
Keywords: pytest,smoke
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytest<9,>=7.0.0
Provides-Extra: dev
Requires-Dist: pre-commit==4.0.1; extra == "dev"
Requires-Dist: ruff==0.7.1; extra == "dev"
Requires-Dist: tox==4.23.2; extra == "dev"

pytest-smoke
======================

[![PyPI](https://img.shields.io/pypi/v/pytest-smoke)](https://pypi.org/project/pytest-smoke/)
[![Supported Python
versions](https://img.shields.io/pypi/pyversions/pytest-smoke.svg)](https://pypi.org/project/pytest-smoke/)
[![test](https://github.com/yugokato/pytest-smoke/actions/workflows/test.yml/badge.svg)](https://github.com/yugokato/pytest-smoke/actions/workflows/test.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/yugokato/pytest-smoke/main.svg)](https://results.pre-commit.ci/latest/github/yugokato/pytest-smoke/main)


A small `pytest` plugin that enables a quick smoke testing against a large test suite by limiting the number of tests from each parametrized test function to up to `N`.

## Installation

```
pip install pytest-smoke
```


## Usage

Given you have the following test code:

```python
import pytest


def test_something1():
    pass
    
@pytest.mark.parametrize("p", range(10))
def test_something2(p):
    pass
    
@pytest.mark.parametrize("p", range(20))
def test_something3(p):
    pass
```

You can run tests with the `--smoke` command option:

- Run only one test from each test function (`N`= default 1)
```
$ pytest -v --smoke
======================== test session starts =========================
<snip>
collected 31 items                                                   

tests/test_demo.py::test_something1 PASSED                     [ 33%]
tests/test_demo.py::test_something2[0] PASSED                  [ 66%]
tests/test_demo.py::test_something3[0] PASSED                  [100%]

========================= 3 passed in 0.02s ==========================
```

- Run up to 3 tests from each test function (`N`=3)
```
$ pytest -v --smoke 3
======================== test session starts =========================
<snip>
collected 31 items                                                   

tests/test_demo.py::test_something1 PASSED                     [ 14%]
tests/test_demo.py::test_something2[0] PASSED                  [ 28%]
tests/test_demo.py::test_something2[1] PASSED                  [ 42%]
tests/test_demo.py::test_something2[2] PASSED                  [ 57%]
tests/test_demo.py::test_something3[0] PASSED                  [ 71%]
tests/test_demo.py::test_something3[1] PASSED                  [ 85%]
tests/test_demo.py::test_something3[2] PASSED                  [100%]

========================= 7 passed in 0.02s ==========================
```
