Skip to content

Conversation

Edward-Bennett
Copy link

This pull request fixes a test called test_lazy_choices_help, which fails on Python 3.13 and 3.14.

The failure happens because argparse started calling the choices object when formatting help output. This causes the test’s getter.assert_not_called() line to fail, even though the behavior is still correct.

To fix this, I made the test version-aware:

  • On Python versions before 3.13, the test still expects the getter to never be called.
  • On Python 3.13 and later, it allows one harmless call and resets the mock so the rest of the test can continue.

This makes the test pass on all versions of Python and keeps the original behavior where possible.

Fixes #1641.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_lazy_choices_help fails on Python 3.14
1 participant