]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Mention how to turn warning to exceptions
authorFederico Caselli <cfederico87@gmail.com>
Wed, 14 Apr 2021 20:44:28 +0000 (22:44 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 20 Apr 2021 20:04:01 +0000 (22:04 +0200)
This helps locating the offending code, since the reported
warning location is not always correct.

References: #6241
Change-Id: I85d3a20e5b428a5003b541b36b9a77f1d7c1acb6

doc/build/changelog/migration_20.rst

index 6e349c8e83399e13c953c5058ab9a5fa5f90825b..765a418e483903f5a76775faf075049ff9f2c0ee 100644 (file)
@@ -177,6 +177,11 @@ suppress any warnings is selected::
 
     SQLALCHEMY_WARN_20=1 python -W always::DeprecationWarning test3.py
 
+Since the reported warning location is not always in the correct place, locating
+the offending code may be difficult without the full stacktrace. This can be achieved
+by transforming the warnings to exceptions by specifying the ``error`` warning filter,
+using Python option ``-W error::DeprecationWarning``.
+
 .. _warnings filter: https://docs.python.org/3/library/warnings.html#the-warnings-filter
 
 With warnings turned on, our program now has a lot to say::