From babcc2a448c196813e9b2785468529ee5e867a52 Mon Sep 17 00:00:00 2001 From: Poolitzer Date: Thu, 12 Aug 2021 08:51:42 +0200 Subject: [PATCH] Add Custom pytest Marker to Ease Development (#2628) Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> --- .github/CONTRIBUTING.rst | 2 ++ setup.cfg | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index 22e08a75f..c73dc34dd 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -85,6 +85,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 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. - Add yourself to the AUTHORS.rst_ file in an alphabetical fashion. diff --git a/setup.cfg b/setup.cfg index ecfc17fad..0873e46c1 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