Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-92886: Remove assert in clinic.permute_optional_groups so that it works when running with optimizations #93228

Closed
wants to merge 3 commits into from

Conversation

jackh-ncl
Copy link
Contributor

@jackh-ncl jackh-ncl commented May 25, 2022

Replacing assert statement with raise AssertionError(). This also fixes a test in test_clinic.py which fails when ran with -O.

#92886

Before:

$ ./python.exe -Om unittest test.test_clinic
.....F.................................................
======================================================================
FAIL: test_have_left_options_but_required_is_empty (test.test_clinic.ClinicGroupPermuterTest.test_have_left_options_but_required_is_empty)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/test_clinic.py", line 156, in test_have_left_options_but_required_is_empty
    self.assertRaises(AssertionError, fn)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: AssertionError not raised by fn

----------------------------------------------------------------------
Ran 55 tests in 0.098s

FAILED (failures=1)

After:

./python.exe -Om unittest test.test_clinic
.......................................................
----------------------------------------------------------------------
Ran 55 tests in 0.098s

OK

… running with optimizations.

Replacing assert statement with `raise AssertionError()`. This also fixes a test_clinic test when running with `-O`.
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@jackh-ncl jackh-ncl marked this pull request as ready for review May 25, 2022 21:24
@iritkatriel
Copy link
Member

Sorry this was done in another PR.

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

Successfully merging this pull request may close these issues.

3 participants