| 1 |
From: Colin Watson <[email protected]> |
| 2 |
Date: Wed, 1 Jul 2026 10:16:42 +0100 |
| 3 |
Subject: Don't parameterize tests using non-Collection iterables |
| 4 |
|
| 5 |
This is deprecated as of pytest 9.1; see |
| 6 |
https://docs.pytest.org/en/stable/deprecations.html#non-collection-iterables-in-pytest-mark-parametrize. |
| 7 |
|
| 8 |
Bug-Debian: https://bugs.debian.org/1140873 |
| 9 |
Forwarded: https://github.com/pallets/click/pull/3656 |
| 10 |
Last-Update: 2026-07-01 |
| 11 |
--- |
| 12 |
tests/test_basic.py | 9 ++++----- |
| 13 |
1 file changed, 4 insertions(+), 5 deletions(-) |
| 14 |
|
| 15 |
diff --git a/tests/test_basic.py b/tests/test_basic.py |
| 16 |
index 3f73528..3889ea1 100644 |
| 17 |
--- a/tests/test_basic.py |
| 18 |
+++ b/tests/test_basic.py |
| 19 |
@@ -2,7 +2,6 @@ from __future__ import annotations |
| 20 |
|
| 21 |
import enum |
| 22 |
import os |
| 23 |
-from itertools import chain |
| 24 |
|
| 25 |
import pytest |
| 26 |
|
| 27 |
@@ -258,10 +257,10 @@ def test_boolean_flag(runner, default, args, expect): |
| 28 |
|
| 29 |
@pytest.mark.parametrize( |
| 30 |
("value", "expect"), |
| 31 |
- chain( |
| 32 |
- ((x, "True") for x in ("1", "true", "t", "yes", "y", "on")), |
| 33 |
- ((x, "False") for x in ("0", "false", "f", "no", "n", "off")), |
| 34 |
- ), |
| 35 |
+ [ |
| 36 |
+ *((x, "True") for x in ("1", "true", "t", "yes", "y", "on")), |
| 37 |
+ *((x, "False") for x in ("0", "false", "f", "no", "n", "off")), |
| 38 |
+ ], |
| 39 |
) |
| 40 |
def test_boolean_conversion(runner, value, expect): |
| 41 |
@click.command() |