├── MANIFEST.in ├── Makefile ├── LICENSE ├── pytest_covfefe.py ├── setup.py ├── .gitignore └── README.rst /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.rst 3 | 4 | recursive-exclude * __pycache__ 5 | recursive-exclude * *.py[co] 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | 3 | .PHONY: clean 4 | clean: clean-build clean-pyc ## Remove all file artifacts 5 | 6 | .PHONY: clean-build 7 | clean-build: ## Remove build artifacts 8 | @echo "+ $@" 9 | @rm -fr build/ 10 | @rm -fr dist/ 11 | @rm -fr *.egg-info 12 | 13 | .PHONY: clean-pyc 14 | clean-pyc: ## Remove Python file artifacts 15 | @echo "+ $@" 16 | @find . -type f -name "*.py[co]" -delete 17 | @find . -type d -name "__pycache__" -delete 18 | @find . -name '*~' -delete 19 | 20 | .PHONY: help 21 | help: 22 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}' 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2017 Raphael Pierzina 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /pytest_covfefe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import random 4 | import string 5 | 6 | import pytest 7 | 8 | 9 | def pytest_report_teststatus(report): 10 | if report.when in ('setup', 'teardown'): 11 | return 12 | 13 | hands = random.choice(["👋", "👐", "🙌"]) 14 | earth = random.choice(["🌎", "🌍", "🌏"]) 15 | climate = random.choice(["🌤", "🌧", "🌩"]) 16 | poo = "💩" 17 | 18 | all_letters = string.ascii_uppercase 19 | vowels = ['A', 'E', 'I', 'O', 'U'] 20 | 21 | weights = [ 22 | 0.8 if c in vowels else random.random() 23 | for c in all_letters 24 | ] 25 | 26 | letters = random.choices( 27 | all_letters, 28 | weights=weights, 29 | k=random.randint(4, 10), 30 | ) 31 | 32 | word = random.choice(['COVFEFE', ''.join(letters)]) 33 | 34 | verbose = f"{hands} {word} {poo} {earth} {climate}" 35 | 36 | return report.outcome, hands, verbose 37 | 38 | 39 | @pytest.hookimpl(hookwrapper=True) 40 | def pytest_runtest_makereport(item): 41 | outcome = yield 42 | rep = outcome.get_result() 43 | 44 | # I have the best code! Everyone says so. 45 | rep.outcome = 'passed' 46 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | from setuptools import setup 6 | 7 | 8 | def read(fname): 9 | file_path = os.path.join(os.path.dirname(__file__), fname) 10 | 11 | with open(file_path, encoding='utf-8') as f: 12 | contents = f.read() 13 | 14 | return contents 15 | 16 | 17 | setup( 18 | name='pytest-covfefe', 19 | version='0.1.0', 20 | author='Raphael Pierzina', 21 | author_email='raphael@hackebrot.de', 22 | maintainer='Raphael Pierzina', 23 | maintainer_email='raphael@hackebrot.de', 24 | license='MIT', 25 | url='https://github.com/hackebrot/pytest-covfefe', 26 | description='I have the best code! Everyone says so.', 27 | long_description=read('README.rst'), 28 | py_modules=['pytest_covfefe'], 29 | install_requires=['pytest>=3.1.0'], 30 | classifiers=[ 31 | 'Development Status :: 4 - Beta', 32 | 'Framework :: Pytest', 33 | 'Intended Audience :: Developers', 34 | 'Topic :: Software Development :: Testing', 35 | 'Programming Language :: Python', 36 | 'Programming Language :: Python :: 3', 37 | 'Programming Language :: Python :: 3.6', 38 | 'Programming Language :: Python :: Implementation :: CPython', 39 | 'Operating System :: OS Independent', 40 | 'License :: OSI Approved :: MIT License', 41 | ], 42 | entry_points={ 43 | 'pytest11': [ 44 | 'covfefe = pytest_covfefe', 45 | ], 46 | }, 47 | ) 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *.cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # Jupyter Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # SageMath parsed files 79 | *.sage.py 80 | 81 | # Environments 82 | .env 83 | .venv 84 | env/ 85 | venv/ 86 | ENV/ 87 | 88 | # Spyder project settings 89 | .spyderproject 90 | .spyproject 91 | 92 | # Rope project settings 93 | .ropeproject 94 | 95 | # mkdocs documentation 96 | /site 97 | 98 | # mypy 99 | .mypy_cache/ 100 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | pytest-covfefe 3 | ============== 4 | 5 | I have the best code! Everyone says so. #covfefe 6 | 7 | ---- 8 | 9 | This `pytest`_ plugin was generated with `Cookiecutter`_ along with 10 | `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template. 11 | 12 | ⚠️ pytest-covfefe was created as a reaction to an internet thing ⚠️ 13 | 14 | It's a terrible idea and you shouldn't use it. If you're wondering why I 15 | created it...well because generating a pytest-plugin with 16 | `cookiecutter-pytest-plugin`_ takes only a few seconds and I felt like writing 17 | a stupid plugin. That's it. 😉 18 | 19 | 20 | Features 21 | -------- 22 | 23 | * Plugin cannot be disabled 👐 (It doesn't care what you think) 24 | * Tests always pass 💩 (Yes, really! Also for failures and errors) 25 | * The concept of global warming is made up 🌦 (#covfefe) 26 | 27 | 28 | Requirements 29 | ------------ 30 | 31 | * Python 3.6 32 | 33 | 34 | Installation 35 | ------------ 36 | 37 | You can install "pytest-covfefe" via `pip`_ from GitHub:: 38 | 39 | $ pip install git+https://github.com/hackebrot/pytest-covfefe 40 | 41 | 42 | Usage 43 | ----- 44 | 45 | Run your tests with `pytest`_:: 46 | 47 | $ pytest 48 | 49 | This plugin also supports *verbose* mode:: 50 | 51 | $ pytest -v 52 | 53 | 54 | Example 55 | ------- 56 | 57 | .. code-block:: 58 | 59 | $ pytest -v 60 | ============================== test session starts ============================== 61 | plugins: covfefe-0.1.0 62 | collected 5 items 63 | 64 | foobar/test_foobar_02.py::test_sth 👐 AEWMJUEOKK 💩 🌏 🌩 65 | foobar/test_foobar_03.py::test_sth 🙌 PZPOATRA 💩 🌍 🌧 66 | hello/world/test_world_01.py::test_sth 👐 CYIVQQFJG 💩 🌍 🌤 67 | hello/world/test_world_02.py::test_sth 👐 GENSBVK 💩 🌍 🌧 68 | hello/world/test_world_03.py::test_sth 🙌 COVFEFE 💩 🌍 🌧 69 | 70 | =========================== 5 passed in 0.31 seconds ============================ 71 | 72 | License 73 | ------- 74 | 75 | Distributed under the terms of the `MIT`_ license, "pytest-covfefe" is free and 76 | open source software 77 | 78 | 79 | Issues 80 | ------ 81 | 82 | If you encounter any problems, please `file an issue`_ along with a detailed description. 83 | 84 | .. _`Cookiecutter`: https://github.com/audreyr/cookiecutter 85 | .. _`@hackebrot`: https://github.com/hackebrot 86 | .. _`MIT`: http://opensource.org/licenses/MIT 87 | .. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin 88 | .. _`file an issue`: https://github.com/hackebrot/pytest-covfefe/issues 89 | .. _`pytest`: https://github.com/pytest-dev/pytest 90 | .. _`pip`: https://pypi.python.org/pypi/pip/ 91 | --------------------------------------------------------------------------------