From 30b33cb8f71e0f94e3b27a413d8644b35d17ae95 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Thu, 11 May 2023 16:51:13 -0600 Subject: [PATCH] TST: expand testing * `test_suite_output()` now also has a few checks for the scenario where the plugin is installed but `--regex` isn't actually used on the CLI --- tests/test_plugin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 4505c16..c0e7c59 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2,6 +2,18 @@ def test_suite_output(pytester): + # a few checks for the scenario where + # pytest-regex is installed as a plugin + # but NO usage of --regex on the pytest + # incantation + dummy_result = pytester.runpytest() + dummy_stdout = dummy_result.stdout.str() + assert "pytest-regex" in dummy_stdout + assert "dummy_regex" not in dummy_stdout + assert "regex-" in dummy_stdout + + # next, check the use of the --regex option + # on the command line result = pytester.runpytest("--regex", "dummy_regex") actual_stdout = result.stdout.str() expected_str1 = "pytest-regex selected"