|
10 | 10 |
|
11 | 11 | # this package |
12 | 12 | from consolekit import click_command |
13 | | -from consolekit.testing import CliRunner, Result, _click_version |
| 13 | +from consolekit.testing import CliRunner, Result, click, click_8_only, not_click_8 |
14 | 14 | from consolekit.tracebacks import TracebackHandler, handle_tracebacks, traceback_handler, traceback_option |
15 | 15 |
|
16 | 16 | exceptions = pytest.mark.parametrize( |
@@ -110,34 +110,15 @@ def test_handle_tracebacks_ignored_exceptions( |
110 | 110 | [ |
111 | 111 | pytest.param(click.UsageError("Message"), 2, id="click.UsageError"), |
112 | 112 | pytest.param(click.BadParameter("Message"), 2, id="click.BadParameter"), |
113 | | - pytest.param( |
114 | | - click.FileError("Message"), |
115 | | - 1, |
116 | | - id="click.FileError", |
117 | | - marks=pytest.mark.skipif(_click_version[0] == 8, reason="Output differs on Click 8") |
118 | | - ), |
119 | | - pytest.param( |
120 | | - click.FileError("Message"), |
121 | | - 1, |
122 | | - id="click.FileError_8", |
123 | | - marks=pytest.mark.skipif(_click_version[0] != 8, reason="Output differs on Click 8") |
124 | | - ), |
| 113 | + pytest.param(click.FileError("Message"), 1, id="click.FileError", marks=click_8_only), |
| 114 | + pytest.param(click.FileError("Message"), 1, id="click.FileError_8", marks=not_click_8), |
125 | 115 | pytest.param(click.ClickException("Message"), 1, id="click.ClickException"), |
126 | 116 | ] |
127 | 117 | ) |
128 | 118 | @contextmanagers |
129 | 119 | @pytest.mark.parametrize( |
130 | 120 | "click_version", |
131 | | - [ |
132 | | - pytest.param( |
133 | | - '7', |
134 | | - marks=pytest.mark.skipif(_click_version[0] == 8, reason="Output differs on click 8"), |
135 | | - ), |
136 | | - pytest.param( |
137 | | - '8', |
138 | | - marks=pytest.mark.skipif(_click_version[0] != 8, reason="Output differs on click 8"), |
139 | | - ), |
140 | | - ] |
| 121 | + [pytest.param('7', marks=click_8_only), pytest.param('8', marks=not_click_8)], |
141 | 122 | ) |
142 | 123 | def test_handle_tracebacks_ignored_click( |
143 | 124 | exception: Exception, |
|
0 commit comments