Skip to content

Conversation

ogrisel
Copy link

@ogrisel ogrisel commented Aug 28, 2025

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Aug 28, 2025
@webknjaz webknjaz added the backport 8.4.x apply to PRs at any point; backports the changes to the 8.4.x branch label Aug 28, 2025
@ogrisel
Copy link
Author

ogrisel commented Aug 28, 2025

@webknjaz CI is green again!

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'll let @RonnyPfannschmidt merge since he was active in the related PR.

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@ogrisel
Copy link
Author

ogrisel commented Sep 1, 2025

@RonnyPfannschmidt if you have a few minutes to finalize this review, that would be very appreciated as it would unlock my work to finalize #13679.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

Tho only nitpick that comes to mind is that it could be more declarative

But thats a low hanging fruit followup

def test_error_messages_with_different_verbosity(
self, assert_approx_raises_regex, monkeypatch: MonkeyPatch
):
monkeypatch.delenv("CI")
Copy link
Member

@nicoddemus nicoddemus Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we want to remove this env var for all tests, correct?

If so, I suggest you add this autouse fixture to conftest.py:

@pytest.fixture(autouse=True)
def remove_ci_env_var(monkeypatch: MonkeyPatch) -> None:
    """
    Make the test suite insensitive if it is running in CI or not.
    
    If a test requires the variable, it should set it explicitly.
    """
    monkeypatch.delenv("CI", raising=False)

Then you can revert the changes done to the tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we might want to use this env var in #13679 to use a longer timeout value in some tests to decrease likelihood of failure on slow CI runners.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more specific: there is an existing test named test_timeout in test_faulhandler.py that relies on the presence of this variable to adjust the value of the timeout to make it less likely to fail in case the CI runner is too slow (see #7022). However, this strategy never worked as intended because the CI variable propagation was always blocked by the existing configuration in tox.ini.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't sure what the impact would be in other places so I didn't suggest making it an autouse fixture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.4.x apply to PRs at any point; backports the changes to the 8.4.x branch bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants