PyDocs

Nav

Development Tools

check_syntax_warning

test.support.warnings_helper

function · Added in 3.8
  • check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None)
Test for syntax warning in statement by attempting to compile statement. Test also that the SyntaxWarning is emitted only once, and that it will be converted to a SyntaxError when turned into error. testcase is the unittest instance for the test. errtext is the regular expression which should match the string representation of the emitted SyntaxWarning and raised SyntaxError. If lineno is not None, compares to the line of the warning and exception. If offset is not None, compares to the offset of the exception.
0 Examples
No examples for test.support.warnings_helper/check_syntax_warning.
See Also
No see-alsos for test.support.warnings_helper/check_syntax_warning
0 Notes
No notes for check_syntax_warning