Accepting request 921548 from devel:languages:python

- Add patch remove-nose.patch:
  * Remove use of nose in the tests.

OBS-URL: https://build.opensuse.org/request/show/921548
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-jmespath?expand=0&rev=19
This commit is contained in:
Dominique Leuenberger 2021-09-30 21:42:55 +00:00 committed by Git OBS Bridge
commit 28ee7d5f17
3 changed files with 42 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 27 03:03:07 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-nose.patch:
* Remove use of nose in the tests.
-------------------------------------------------------------------
Mon May 31 08:00:06 UTC 2021 - pgajdos@suse.com

View File

@ -22,12 +22,11 @@ Version: 0.10.0
Release: 0
Summary: Python module for declarative JSON document element extraction
License: MIT
Group: Development/Languages/Python
URL: https://github.com/jmespath/jmespath.py
Source: https://github.com/jmespath/jmespath.py/archive/refs/tags/%{version}.tar.gz#/jmespath-%{version}.tar.gz
Patch0: remove-nose.patch
# Testing
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module ply >= 3.4}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module simplejson}
@ -73,6 +72,7 @@ The expression: foo.*.name will return ["one", "two"].
%prep
%setup -q -n jmespath.py-%{version}
%autopatch -p1
%build
%python_build

34
remove-nose.patch Normal file
View File

@ -0,0 +1,34 @@
Index: jmespath.py-0.10.0/extra/test_hypothesis.py
===================================================================
--- jmespath.py-0.10.0.orig/extra/test_hypothesis.py
+++ jmespath.py-0.10.0/extra/test_hypothesis.py
@@ -6,7 +6,6 @@ import os
import sys
import numbers
-from nose.plugins.skip import SkipTest
from hypothesis import given, settings, assume, HealthCheck
import hypothesis.strategies as st
Index: jmespath.py-0.10.0/tests/test_compliance.py
===================================================================
--- jmespath.py-0.10.0.orig/tests/test_compliance.py
+++ jmespath.py-0.10.0/tests/test_compliance.py
@@ -3,8 +3,6 @@ from pprint import pformat
from tests import OrderedDict
from tests import json
-from nose.tools import assert_equal
-
from jmespath.visitor import Options
@@ -80,7 +78,7 @@ def _test_expression(given, expression,
actual_repr, pformat(parsed.parsed),
json.dumps(given, indent=4)))
error_msg = error_msg.replace(r'\n', '\n')
- assert_equal(actual, expected, error_msg)
+ assert actual == expected, error_msg
def _test_error_expression(given, expression, error, filename):