Skip to content
Myr

Don't parameterize tests using non-Collection iterables

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This is deprecated as of pytest 9.1; see https://docs.pytest.org/en/stable/deprecations.html#non-collection-iterables-in-pytest-mark-parametrize.

authored by Colin Watson · committed by Colin Watson · parent 240603f · Browse files · 2 files+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−5 removed

  • tests:+4 added−5 removed
  • other:+1 added−0 removed

2 files+5 added−5 removed

modified:tests/test_basic.py+4 added-5 removed
1from __future__ import annotations23import enum4import os5from itertools import chain56import pytest78import click
247 unmodified lines
256257258@pytest.mark.parametrize(259 ("value", "expect"),261 chain(262 ((x, "True") for x in ("1", "true", "t", "yes", "y", "on")),263 ((x, "False") for x in ("0", "false", "f", "no", "n", "off")),264 ),260 [261 *((x, "True") for x in ("1", "true", "t", "yes", "y", "on")),262 *((x, "False") for x in ("0", "false", "f", "no", "n", "off")),263 ],264)265def test_boolean_conversion(runner, value, expect):266 @click.command()267 @click.option("--flag", type=bool)
592 unmodified lines
modified:CHANGES.md+1 added
4 unmodified lines
5- Supported versions of Windows enable ANSI terminal styles by default.6 Colorama is no longer a dependency and is not used. {issue}`2986` {pr}`3505`7- {class}`Argument` accepts a `help` parameter, and help output includes8 a `Positional arguments` section when argument help is available. {issue}`2983` {pr}`3473`9- Fix test failures when using pytest >= 9.1. {pr}`3656`1011## Version 8.4.21213Released 2026-06-24
1561 unmodified lines