From 0f6cd577ee0e40fa5561e359e49449a857feddea Mon Sep 17 00:00:00 2001 From: Pavel Cahyna Date: Tue, 29 Jun 2021 18:31:36 +0200 Subject: [PATCH] Remove the python-nose dependency Replace by pytest Resolves: rhbz1916775 --- nonose.patch | 13 +++++++++++++ python-jmespath.spec | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 nonose.patch diff --git a/nonose.patch b/nonose.patch new file mode 100644 index 0000000..7579115 --- /dev/null +++ b/nonose.patch @@ -0,0 +1,13 @@ +diff -up jmespath-0.9.4/tests/test_compliance.py.orig jmespath-0.9.4/tests/test_compliance.py +--- jmespath-0.9.4/tests/test_compliance.py.orig 2017-05-13 19:21:34.000000000 +0200 ++++ jmespath-0.9.4/tests/test_compliance.py 2021-06-29 11:34:10.355125102 +0200 +@@ -3,7 +3,8 @@ from pprint import pformat + from tests import OrderedDict + from tests import json + +-from nose.tools import assert_equal ++import unittest ++assert_equal = unittest.TestCase().assertEqual + + from jmespath.visitor import Options + diff --git a/python-jmespath.spec b/python-jmespath.spec index bdb4982..0de8b46 100644 --- a/python-jmespath.spec +++ b/python-jmespath.spec @@ -10,6 +10,8 @@ URL: https://github.com/jmespath/jmespath.py Source0: https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch +Patch: nonose.patch + %description JMESPath allows you to declaratively specify how to extract elements from a JSON document. @@ -20,8 +22,8 @@ Summary: JSON Matching Expressions %{?python_provide:%python_provide python-%{pypi_name}} BuildRequires: python3-devel -BuildRequires: python3-nose BuildRequires: python3-setuptools +BuildRequires: python3-pytest Obsoletes: python2-jmespath < 0.9.4-2 @@ -31,6 +33,7 @@ a JSON document. %prep %setup -q -n %{pypi_name}-%{version} +%patch -p1 rm -rf %{pypi_name}.egg-info %build @@ -40,7 +43,7 @@ rm -rf %{pypi_name}.egg-info %py3_install %check -nosetests-%{python3_version} +%pytest %files -n python3-%{pypi_name} %doc README.rst