Skip to content

Commit a66563c

Browse files
committed
Fix test with pytest
1 parent 91df3a4 commit a66563c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/test_folium.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,11 @@ def test_deprecation_warning():
358358
359359
This test may catch warnings on importing other libraries.
360360
"""
361-
with warnings.catch_warnings(record=True) as caught_warnings:
362-
warnings.simplefilter("always")
361+
with pytest.warns(None) as caught_warnings:
363362
importlib.reload(folium)
364-
expected_warning_count = 1 if sys.version_info < (3, 0) else 0
365-
assert(len(caught_warnings) == expected_warning_count)
366-
if expected_warning_count == 1:
367-
w = caught_warnings[0]
368-
assert issubclass(w.category, PendingDeprecationWarning)
369-
assert str(w.message).startswith('folium will stop working with')
363+
expected_warning_count = 1 if sys.version_info < (3, 0) else 0
364+
assert(len(caught_warnings) == expected_warning_count)
365+
if expected_warning_count == 1:
366+
w = caught_warnings[0]
367+
assert issubclass(w.category, PendingDeprecationWarning)
368+
assert str(w.message).startswith('folium will stop working with')

0 commit comments

Comments
 (0)