From 9e6a6646f00b7742eb358dd7b45c74da63bc5d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 19 Apr 2019 14:36:15 +0200 Subject: [PATCH] Add fix for pytest 4 https://github.com/Ultimaker/Uranium/pull/482 --- 482.patch | 31 +++++++++++++++++++++++++++++++ python-uranium.spec | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 482.patch diff --git a/482.patch b/482.patch new file mode 100644 index 0000000..66ab171 --- /dev/null +++ b/482.patch @@ -0,0 +1,31 @@ +From 3d1c83677c8151fa151822473a1021d783cf6daf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 19 Apr 2019 14:32:24 +0200 +Subject: [PATCH] Support Pytest 4, config.warn is no more + +https://docs.pytest.org/en/latest/deprecations.html#config-warn-and-node-warn +--- + tests/benchmarks/conftest.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/benchmarks/conftest.py b/tests/benchmarks/conftest.py +index d08442e9f..6fc1c9ebd 100644 +--- a/tests/benchmarks/conftest.py ++++ b/tests/benchmarks/conftest.py +@@ -2,6 +2,7 @@ + # Uranium is released under the terms of the LGPLv3 or higher. + + import pytest ++import warnings + + warn = True + +@@ -12,7 +13,7 @@ def pytest_ignore_collect(path, config): + else: + global warn + if warn: +- config.warn("", "Skipping benchmarks because pytest-benchmark plugin was not found.", "tests/benchmarks/conftest.py") ++ warnings.warn(pytest.PytestWarning("Skipping benchmarks because pytest-benchmark plugin was not found.")) + warn = False + + return True diff --git a/python-uranium.spec b/python-uranium.spec index 9f74b91..7025660 100644 --- a/python-uranium.spec +++ b/python-uranium.spec @@ -6,6 +6,9 @@ License: LGPLv3+ URL: https://github.com/Ultimaker/Uranium Source0: %{url}/archive/%{version}.tar.gz#/Uranium-%{version}.tar.gz +# pytest 4 +Patch1: %{url}/pull/482.patch + BuildRequires: python3-devel BuildRequires: python3-pip BuildRequires: /usr/bin/doxygen