From 5773a6a69a712345c2b54e952beab625a41db17b Mon Sep 17 00:00:00 2001 From: poolitzer <25934244+Poolitzer@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:28:51 +0200 Subject: [PATCH 1/2] Feat: Custom pytest marker --- .github/CONTRIBUTING.rst | 2 ++ setup.cfg | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index 7aaf44360cf..abcf0ce54b3 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -105,6 +105,8 @@ Here's how to make a one-off code change. - Please ensure that the code you write is well-tested. + - In addition to that, we provide the `dev` marker for pytest. If you write one or multiple tests and only want to run those, you can decorate them via `@pytest.mark.dev` and then run it with minimal overhead with `pytest ./path/to/test_file.py -m dev`. + - Don’t break backward compatibility. - Add yourself to the AUTHORS.rst_ file in an alphabetical fashion. diff --git a/setup.cfg b/setup.cfg index f013075113f..98748321afb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,6 +30,7 @@ filterwarnings = ; Unfortunately due to https://github.com/pytest-dev/pytest/issues/8343 we can't have this here ; and instead do a trick directly in tests/conftest.py ; ignore::telegram.utils.deprecate.TelegramDeprecationWarning +markers = dev: If you want to test a specific test, use this [coverage:run] branch = True From 2d8a295bccdebada2aa08da797131fb5acab7273 Mon Sep 17 00:00:00 2001 From: Poolitzer Date: Thu, 12 Aug 2021 08:40:55 +0200 Subject: [PATCH 2/2] Fix: Only better position Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> --- .github/CONTRIBUTING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index abcf0ce54b3..d627ec24e66 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -105,7 +105,7 @@ Here's how to make a one-off code change. - Please ensure that the code you write is well-tested. - - In addition to that, we provide the `dev` marker for pytest. If you write one or multiple tests and only want to run those, you can decorate them via `@pytest.mark.dev` and then run it with minimal overhead with `pytest ./path/to/test_file.py -m dev`. + - In addition to that, we provide the `dev` marker for pytest. If you write one or multiple tests and want to run only those, you can decorate them via `@pytest.mark.dev` and then run it with minimal overhead with `pytest ./path/to/test_file.py -m dev`. - Don’t break backward compatibility.