# pytest-bug
[![PyPI](https://img.shields.io/pypi/v/pytest-bug.svg?color=%2301a001&label=pypi)](https://pypi.org/project/pytest-bug/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-bug.svg)](https://pypi.org/project/pytest-bug/)
[![pytes_support](https://img.shields.io/badge/pytest-%3E%3D7.1.0-blue.svg)](https://github.com/pytest-dev/pytest/releases)
[![Downloads](https://pepy.tech/badge/pytest-bug)](https://pepy.tech/project/pytest-bug)
[![Build Pypi](https://github.com/tolstislon/pytest-bug/actions/workflows/python-publish.yml/badge.svg)](https://github.com/tolstislon/pytest-bug/actions/workflows/python-publish.yml)
[Pytest](https://github.com/pytest-dev/pytest) plugin for marking tests as a bug
Installation
----
```bash
pip install pytest-bug
```
### Example
```python
import pytest
@pytest.mark.bug("C18", "Critical bug") # mark skip test
def test_one():
assert False
@pytest.mark.bug("C39", "Minor bug", run=True) # mark xfail test if fail else pass
def test_two():
assert False
@pytest.mark.bug("C41", "Minor bug", run=True)
def test_three():
assert True
@pytest.mark.bug("Bug all tests")
class TestFour:
def test_one(self): # mark skip test
assert False
def test_two(self): # mark skip test
assert True
@pytest.mark.bug("Unstable tests", run=True)
class TestFive:
def test_one(self): # mark xfail
assert False
def test_two(self): # pass
assert True
```
```bash
$ pytest
======================== test session starts ========================
platform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR
plugins: bug-x.y.z
collected 7 items
test_sample.py bfpbbfp
---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------
=================== 2 passed, 5 skipped in 0.10s ===================
```
Symbols:
* `b` - bug skip
* `f` - bug fail
* `p` - bug pass
##### verbosity
```bash
$ pytest -v
======================== test session starts ========================
platform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR
plugins: bug-x.y.z
collected 7 items
test_sample.py::test_one BUG-SKIP [ 14%]
test_sample.py::test_two BUG-FAIL [ 28%]
test_sample.py::test_three BUG-PASS [ 42%]
test_sample.py::TestFour::test_one BUG-SKIP [ 57%]
test_sample.py::TestFour::test_two BUG-SKIP [ 71%]
test_sample.py::TestFive::test_one BUG-FAIL [ 85%]
test_sample.py::TestFive::test_two BUG-PASS [100%]
---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------
=================== 2 passed, 5 skipped in 0.10s ===================
```
Options:
| option | description | config |
|--------------------------|---------------------------------------------------------------------|--------------------------|
| --bug-no-stats | Disabling summary statistics | bug_summary_stats (bool) |
| --bug-pattern=REGEX | Run matching tests marked as bug | - |
| --bug-all-run | Includes all bugs in the run | - |
| --bug-all-skip | Disables all bugs in the run | - |
| --bug-skip-letter=LETTER | Set to output in console for skip-bug (default: b) | bug_skip_letter (string) |
| --bug-fail-letter=LETTER | Set to output in console for fail-bug (default: f) | bug_fail_letter (string) |
| --bug-pass-letter=LETTER | Set to output in console for pass-bug (default: p) | bug_pass_letter (string) |
| --bug-skip-word=WORLD | Set to output in console for skip-bug verbosity (default: BUG-SKIP) | bug_skip_word (string) |
| --bug-fail-word=WORLD | Set to output in console for fail-bug verbosity (default: BUG-FAIL) | bug_fail_word (string) |
| --bug-pass-word=WORLD | Set to output in console for fail-bug verbosity (default: BUG-PASS) | bug_pass_word (string) |
#### Contributions are very welcome.
###### Getting started
* python 3.11
* pipenv 2022.12.19+
1. Clone the repository
```bash
git clone https://github.com/tolstislon/pytest-bug.git
cd pytest-bug
```
2. Install dev dependencies
```bash
pipenv install --dev
pipenv shell
```
3. Run the black
```bash
pipenv run black
```
4. Run the tests
```bash
pipenv run tests
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tolstislon/pytest-bug",
"name": "pytest-bug",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "pytest",
"author": "tolstislon",
"author_email": "tolstislon@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ca/3e/265aff891cdb00c5fbbc6766af1e88c562abdd0a71330137a1c62b92a681/pytest-bug-1.3.1.tar.gz",
"platform": null,
"description": "# pytest-bug\n\n[![PyPI](https://img.shields.io/pypi/v/pytest-bug.svg?color=%2301a001&label=pypi)](https://pypi.org/project/pytest-bug/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-bug.svg)](https://pypi.org/project/pytest-bug/)\n[![pytes_support](https://img.shields.io/badge/pytest-%3E%3D7.1.0-blue.svg)](https://github.com/pytest-dev/pytest/releases)\n[![Downloads](https://pepy.tech/badge/pytest-bug)](https://pepy.tech/project/pytest-bug)\n[![Build Pypi](https://github.com/tolstislon/pytest-bug/actions/workflows/python-publish.yml/badge.svg)](https://github.com/tolstislon/pytest-bug/actions/workflows/python-publish.yml)\n\n[Pytest](https://github.com/pytest-dev/pytest) plugin for marking tests as a bug\n\nInstallation\n----\n\n```bash\npip install pytest-bug\n```\n\n### Example\n\n```python\nimport pytest\n\n\n@pytest.mark.bug(\"C18\", \"Critical bug\") # mark skip test\ndef test_one():\n assert False\n\n\n@pytest.mark.bug(\"C39\", \"Minor bug\", run=True) # mark xfail test if fail else pass\ndef test_two():\n assert False\n\n\n@pytest.mark.bug(\"C41\", \"Minor bug\", run=True)\ndef test_three():\n assert True\n\n\n@pytest.mark.bug(\"Bug all tests\")\nclass TestFour:\n\n def test_one(self): # mark skip test\n assert False\n\n def test_two(self): # mark skip test\n assert True\n\n\n@pytest.mark.bug(\"Unstable tests\", run=True)\nclass TestFive:\n\n def test_one(self): # mark xfail\n assert False\n\n def test_two(self): # pass\n assert True\n```\n\n```bash\n$ pytest\n\n======================== test session starts ========================\nplatform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z\ncachedir: $PYTHON_PREFIX/.pytest_cache\nrootdir: $REGENDOC_TMPDIR\nplugins: bug-x.y.z\ncollected 7 items\n\ntest_sample.py bfpbbfp\n\n---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------\n=================== 2 passed, 5 skipped in 0.10s ===================\n```\n\nSymbols:\n\n* `b` - bug skip\n* `f` - bug fail\n* `p` - bug pass\n\n##### verbosity\n\n```bash\n$ pytest -v\n\n======================== test session starts ========================\nplatform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z\ncachedir: $PYTHON_PREFIX/.pytest_cache\nrootdir: $REGENDOC_TMPDIR\nplugins: bug-x.y.z\ncollected 7 items\n\ntest_sample.py::test_one BUG-SKIP [ 14%]\ntest_sample.py::test_two BUG-FAIL [ 28%]\ntest_sample.py::test_three BUG-PASS [ 42%]\ntest_sample.py::TestFour::test_one BUG-SKIP [ 57%]\ntest_sample.py::TestFour::test_two BUG-SKIP [ 71%]\ntest_sample.py::TestFive::test_one BUG-FAIL [ 85%]\ntest_sample.py::TestFive::test_two BUG-PASS [100%]\n\n---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------\n=================== 2 passed, 5 skipped in 0.10s ===================\n```\n\nOptions:\n\n| option | description | config |\n|--------------------------|---------------------------------------------------------------------|--------------------------|\n| --bug-no-stats | Disabling summary statistics | bug_summary_stats (bool) | \n| --bug-pattern=REGEX | Run matching tests marked as bug | - |\n| --bug-all-run | Includes all bugs in the run | - |\n| --bug-all-skip | Disables all bugs in the run | - |\n| --bug-skip-letter=LETTER | Set to output in console for skip-bug (default: b) | bug_skip_letter (string) |\n| --bug-fail-letter=LETTER | Set to output in console for fail-bug (default: f) | bug_fail_letter (string) |\n| --bug-pass-letter=LETTER | Set to output in console for pass-bug (default: p) | bug_pass_letter (string) |\n| --bug-skip-word=WORLD | Set to output in console for skip-bug verbosity (default: BUG-SKIP) | bug_skip_word (string) |\n| --bug-fail-word=WORLD | Set to output in console for fail-bug verbosity (default: BUG-FAIL) | bug_fail_word (string) |\n| --bug-pass-word=WORLD | Set to output in console for fail-bug verbosity (default: BUG-PASS) | bug_pass_word (string) |\n\n#### Contributions are very welcome.\n###### Getting started\n\n* python 3.11\n* pipenv 2022.12.19+\n\n1. Clone the repository\n ```bash\n git clone https://github.com/tolstislon/pytest-bug.git\n cd pytest-bug\n ```\n2. Install dev dependencies\n ```bash\n pipenv install --dev\n pipenv shell\n ```\n3. Run the black\n ```bash\n pipenv run black\n ```\n4. Run the tests\n ```bash\n pipenv run tests\n ```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Pytest plugin for marking tests as a bug",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://github.com/tolstislon/pytest-bug"
},
"split_keywords": [
"pytest"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "feda2ba35de7d43b3a3c28092a57c5f0f5e9f33dfa17d98158cbc523342d6b89",
"md5": "1ac886a31906b23d904a8bdbc15b6b8c",
"sha256": "93ee54d78e426109ad45394580b6217970fff5f32533d61b90246793e63adfee"
},
"downloads": -1,
"filename": "pytest_bug-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1ac886a31906b23d904a8bdbc15b6b8c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7056,
"upload_time": "2023-09-23T14:24:05",
"upload_time_iso_8601": "2023-09-23T14:24:05.850317Z",
"url": "https://files.pythonhosted.org/packages/fe/da/2ba35de7d43b3a3c28092a57c5f0f5e9f33dfa17d98158cbc523342d6b89/pytest_bug-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ca3e265aff891cdb00c5fbbc6766af1e88c562abdd0a71330137a1c62b92a681",
"md5": "1e779a4e2afd250fdb818be38399da63",
"sha256": "950ca7b4ed6a5624d7473fbb4e1b36f73230057ef4395910b8edbe0f4000adbb"
},
"downloads": -1,
"filename": "pytest-bug-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "1e779a4e2afd250fdb818be38399da63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10987,
"upload_time": "2023-09-23T14:24:07",
"upload_time_iso_8601": "2023-09-23T14:24:07.462543Z",
"url": "https://files.pythonhosted.org/packages/ca/3e/265aff891cdb00c5fbbc6766af1e88c562abdd0a71330137a1c62b92a681/pytest-bug-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-23 14:24:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tolstislon",
"github_project": "pytest-bug",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytest-bug"
}