From 4bdb53ee233773f53e745b5ffc94aa65fd272df5 Mon Sep 17 00:00:00 2001 From: timmyloos <122990491+timmyloos@users.noreply.github.com> Date: Fri, 23 Oct 2026 20:56:01 -0400 Subject: [PATCH 1/2] Move pytest options from setup.cfg into pytest.ini pytest reads only the first config file it finds, and pytest.ini takes precedence over setup.cfg. The [tool:pytest] section in setup.cfg was therefore silently ignored (pytest prints "ignoring pytest config in setup.cfg!"), so `make test` never ran the doctests enabled by --doctest-modules and xfail_strict was not enforced. Moving the options into pytest.ini restores the intended configuration: 8 doctests in httpie/ and tests/utils/ are now collected, and all pass. --- pytest.ini | 5 +++++ setup.cfg | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pytest.ini b/pytest.ini index ced65979b1..e397e9e4c3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,9 @@ [pytest] +# +testpaths = httpie tests +norecursedirs = tests/fixtures +addopts = --tb=native --doctest-modules --verbose +xfail_strict = True markers = # If you want to run tests without a full HTTPie installation # we advise you to disable the markers below, e.g: diff --git a/setup.cfg b/setup.cfg index 85490981aa..6960ad56fd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,13 +5,6 @@ [wheel] -[tool:pytest] -# -testpaths = httpie tests -norecursedirs = tests/fixtures -addopts = --tb=native --doctest-modules --verbose -xfail_strict = True - [metadata] name = httpie version = attr: httpie.__version__ From 492f03e157cddcc9a6e4ffe95103919b740f0689 Mon Sep 17 00:00:00 2001 From: timmyloos <122990491+timmyloos@users.noreply.github.com> Date: Sat, 24 Oct 2026 17:47:16 -0400 Subject: [PATCH 2/2] Keep flaky test_quiet_on_python_warnings xfail non-strict With xfail_strict now applied from pytest.ini, this test fails on Windows + Python 3.7 in CI with [XPASS(strict)]. Its xfail exists only because the result is unreliable on Windows (see the comment above it), so an occasional pass is expected. Mark it strict=False to keep the previous behaviour for this test while enforcing strict xfail elsewhere. --- tests/test_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_output.py b/tests/test_output.py index 2242177dbc..e90db06ab8 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -98,7 +98,7 @@ def test_quiet_quiet_with_check_status_non_zero_pipe(self, httpbin): (['-qq'], 0), ]) # Might fail on Windows due to interference from other warnings. - @pytest.mark.xfail + @pytest.mark.xfail(strict=False) def test_quiet_on_python_warnings(self, test_patch, httpbin, flags, expected_warnings): def warn_and_run(*args, **kwargs): warnings.warn('warning!!')