diff --git a/CHANGES/1219.misc b/CHANGES/1219.misc new file mode 100644 index 000000000..da81c1a3c --- /dev/null +++ b/CHANGES/1219.misc @@ -0,0 +1 @@ +Add pytest markers for parsers and connection types diff --git a/pyproject.toml b/pyproject.toml index 5d9fcd01a..a5f1ab9e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,3 +7,11 @@ issue_format = "#{issue}" underlines = ["", ""] template = ".towncrier.md.jinja" title_format = "## {version} - ({project_date})" + +[tool.pytest.ini_options] +markers = [ + "hiredis_parser: mark a test as using hiredis parser", + "python_parser: mark a test as using python parser", + "connection_pool: mark a test as using connection_pool client", + "single_connection: mark a test as using single connection client", +] diff --git a/tests/conftest.py b/tests/conftest.py index 9d8520545..dc76ad18e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -132,27 +132,39 @@ def skip_unless_arch_bits(arch_bits): @pytest.fixture( params=[ - (True, PythonParser), - (False, PythonParser), + pytest.param( + (True, PythonParser), + marks=[pytest.mark.python_parser, pytest.mark.single_connection], + id="single-connection-python-parser", + ), + pytest.param( + (False, PythonParser), + marks=[pytest.mark.python_parser, pytest.mark.connection_pool], + id="pool-python-parser", + ), pytest.param( (True, HiredisParser), - marks=pytest.mark.skipif( - not HIREDIS_AVAILABLE, reason="hiredis is not installed" - ), + marks=[ + pytest.mark.skipif( + not HIREDIS_AVAILABLE, reason="hiredis is not installed" + ), + pytest.mark.hiredis_parser, + pytest.mark.single_connection, + ], + id="single-connection-hiredis", ), pytest.param( (False, HiredisParser), - marks=pytest.mark.skipif( - not HIREDIS_AVAILABLE, reason="hiredis is not installed" - ), + marks=[ + pytest.mark.skipif( + not HIREDIS_AVAILABLE, reason="hiredis is not installed" + ), + pytest.mark.hiredis_parser, + pytest.mark.connection_pool, + ], + id="pool-hiredis", ), ], - ids=[ - "single-python-parser", - "pool-python-parser", - "single-hiredis", - "pool-hiredis", - ], ) def create_redis(request, event_loop): """Wrapper around aioredis.create_redis."""