From 6e8cc427b2eaf66e36ccca5cd56f13a2a4eac990 Mon Sep 17 00:00:00 2001 From: Mehmet Bektas Date: Thu, 28 Mar 2024 10:23:10 -0700 Subject: [PATCH] update deprecated pytest usage --- papermill/tests/test_iorw.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/papermill/tests/test_iorw.py b/papermill/tests/test_iorw.py index f5d6ae66..1ac5406d 100644 --- a/papermill/tests/test_iorw.py +++ b/papermill/tests/test_iorw.py @@ -4,6 +4,7 @@ import unittest from tempfile import TemporaryDirectory from unittest.mock import Mock, patch +import warnings import nbformat import pytest @@ -137,9 +138,9 @@ def test_read_with_invalid_file_extension(self): self.papermill_io.read("fake/path/fakeinputpath.ipynb1") def test_read_with_valid_file_extension(self): - with pytest.warns(None) as warns: + with warnings.catch_warnings(): + warnings.simplefilter("error") self.papermill_io.read("fake/path/fakeinputpath.ipynb") - self.assertEqual(len(warns), 0) def test_read_yaml_with_no_file_extension(self): with pytest.warns(UserWarning):