diff --git a/Minimal-patch-for-compatibility-with-pytest-8.patch b/Minimal-patch-for-compatibility-with-pytest-8.patch new file mode 100644 index 0000000..ee4e072 --- /dev/null +++ b/Minimal-patch-for-compatibility-with-pytest-8.patch @@ -0,0 +1,38 @@ +From c9b2f767a4c40fecf0aecee8802dc445299fb5da Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +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 + diff --git a/python-papermill.spec b/python-papermill.spec index 6769071..6ae5b31 100644 --- a/python-papermill.spec +++ b/python-papermill.spec @@ -35,6 +35,10 @@ Source0: %{pypi_source papermill} # Rebased onto 2.5.0 Patch: fix-broken-build.patch +# Compatibility with pytest 8 +# https://github.com/nteract/papermill/commit/a2f4f2d186 +Patch: Minimal-patch-for-compatibility-with-pytest-8.patch + BuildArch: noarch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86}