SIGN IN SIGN UP

bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867)

* bpo-43497: Emit SyntaxWarnings for assertions with tuple constants.

Add a test that shows that a tuple constant (a tuple, where all of its
members are also compile-time constants) produces a SyntaxWarning. Then
fix this failure.

* Make SyntaxWarnings also work when "optimized".

* Split tests for SyntaxWarning to SyntaxError conversion

SyntaxWarnings emitted by the compiler when configured to be errors are
actually raised as SyntaxError exceptions.

Move these tests into their own method and add a test to ensure they are
raised. Previously we only tested that they were not raised for a
"valid" assertion statement.
T
tsukasa-au committed
a8ef4572a6b28bcfc0b10b34fa4204954b9dd761
Parent: 1330338
Committed by GitHub <noreply@github.com> on 3/16/2021, 11:14:41 AM