Skip to content

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