Blob Blame History Raw
From c9b2f767a4c40fecf0aecee8802dc445299fb5da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Thu, 18 Apr 2024 13:43:16 +0200
Subject: [PATCH] Minimal patch for compatibility with pytest 8

The patch was inspired by upstream commit:
https://github.com/nteract/papermill/commit/a2f4f2d186fcf63acaf03670876189fb15b246bf
---
 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 f7c30b2..2d6f6f6 100644
--- a/papermill/tests/test_iorw.py
+++ b/papermill/tests/test_iorw.py
@@ -6,6 +6,7 @@ import os
 import io
 import nbformat
 import pytest
+import warnings
 
 from requests.exceptions import ConnectionError
 from tempfile import TemporaryDirectory
@@ -147,9 +148,9 @@ class TestPapermillIO(unittest.TestCase):
             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):
-- 
2.44.0