mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
#6513: fix example code: warning categories are classes, not instances.
This commit is contained in:
parent
130ae15183
commit
b4d0ef91a5
1 changed files with 1 additions and 1 deletions
|
|
@ -204,7 +204,7 @@ check::
|
||||||
fxn()
|
fxn()
|
||||||
# Verify some things
|
# Verify some things
|
||||||
assert len(w) == 1
|
assert len(w) == 1
|
||||||
assert isinstance(w[-1].category, DeprecationWarning)
|
assert issubclass(w[-1].category, DeprecationWarning)
|
||||||
assert "deprecated" in str(w[-1].message)
|
assert "deprecated" in str(w[-1].message)
|
||||||
|
|
||||||
One can also cause all warnings to be exceptions by using ``error`` instead of
|
One can also cause all warnings to be exceptions by using ``error`` instead of
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue