File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1346,13 +1346,35 @@ Filter Warnings
13461346
13471347This example shows how to suppress the :class :`neo4j.ExperimentalWarning` using the :func:`python:warnings.filterwarnings` function.
13481348
1349+ .. code- block:: python
1350+
1351+ import warnings
1352+ from neo4j import ExperimentalWarning
1353+
1354+ ...
1355+
1356+ with warnings.catch_warnings():
1357+ warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
1358+ ... # the call emitting the ExperimentalWarning
1359+
1360+ ...
1361+
1362+ This will only mute the :class :`neo4j.ExperimentalWarning` for everything inside
1363+ the `` with `` - block. This is the preferred way to mute warnings, as warnings
1364+ triggerd by new code will still be visible.
1365+
1366+ However, should you want to mute it for the entire application, use the
1367+ following code:
1368+
13491369.. code- block:: python
13501370
13511371 import warnings
13521372 from neo4j import ExperimentalWarning
13531373
13541374 warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
13551375
1376+ ...
1377+
13561378
13571379** ******
13581380Bookmark
You can’t perform that action at this time.
0 commit comments