From e013160ed74e7062a93a8b47f598d89c97932b1e709116df791e8e40c9b5f2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 4 May 2020 13:02:02 +0000 Subject: [PATCH] Accepting request 800051 from home:polslinux:branches:devel:languages:python - Use pytest instead of nose - Add use_pytest.patch OBS-URL: https://build.opensuse.org/request/show/800051 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-purl?expand=0&rev=6 --- python-purl.changes | 6 +++++ python-purl.spec | 9 ++++--- use_pytest.patch | 64 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 use_pytest.patch diff --git a/python-purl.changes b/python-purl.changes index 9825408..5ea706d 100644 --- a/python-purl.changes +++ b/python-purl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 4 12:41:10 UTC 2020 - Paolo Stivanin + +- Use pytest instead of nose +- Add use_pytest.patch + ------------------------------------------------------------------- Sun Jun 9 15:12:31 UTC 2019 - Jan Engelhardt diff --git a/python-purl.spec b/python-purl.spec index b9a8ff9..430a878 100644 --- a/python-purl.spec +++ b/python-purl.spec @@ -1,7 +1,7 @@ # # spec file for package python-purl # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,9 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/codeinthehole/purl Source: https://github.com/codeinthehole/purl/archive/%{version}.tar.gz -BuildRequires: %{python_module nose} +# https://github.com/codeinthehole/purl/pull/42 +Patch0: use_pytest.patch +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes @@ -39,6 +41,7 @@ An immutable URL class for URL building and manipulation. %prep %setup -q -n purl-%{version} +%patch0 -p1 %build %python_build @@ -48,7 +51,7 @@ An immutable URL class for URL building and manipulation. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} nosetests-%{$python_bin_suffix} -v +%pytest tests/utils_tests.py tests/expansion_tests.py tests/template_tests.py tests/url_tests.py %files %{python_files} %doc README.rst diff --git a/use_pytest.patch b/use_pytest.patch new file mode 100644 index 0000000..01bdd59 --- /dev/null +++ b/use_pytest.patch @@ -0,0 +1,64 @@ +diff -ru a/makefile b/makefile +--- a/makefile 2019-03-10 21:51:02.000000000 +0100 ++++ b/makefile 2020-05-04 14:33:39.928123174 +0200 +@@ -3,7 +3,7 @@ + python setup.py develop + + test: +- nosetests ++ pytest tests/ + + package: clean + # Test these packages in a fresh virtualenvs: +Only in b: .pytest_cache +diff -ru a/requirements.txt b/requirements.txt +--- a/requirements.txt 2019-03-10 21:51:02.000000000 +0100 ++++ b/requirements.txt 2020-05-04 14:33:54.216151730 +0200 +@@ -4,5 +4,5 @@ + wheel==0.33.1 + + # Testing +-nose==1.3.7 ++pytest + tox==3.7.0 +diff -ru a/runtests.sh b/runtests.sh +--- a/runtests.sh 2019-03-10 21:51:02.000000000 +0100 ++++ b/runtests.sh 2020-05-04 14:34:09.352181984 +0200 +@@ -1,5 +1,3 @@ + #!/usr/bin/env bash + +-# The doctests only work in Python2.* due to unicode issues that I +-# don't know how to solve. +-nosetests --with-doctest --doctest-extension=rst -s $@ ++pytest tests/ +diff -ru a/tests/expansion_tests.py b/tests/expansion_tests.py +--- a/tests/expansion_tests.py 2019-03-10 21:51:02.000000000 +0100 ++++ b/tests/expansion_tests.py 2020-05-04 14:29:32.167627853 +0200 +@@ -1,8 +1,6 @@ + # -*- coding: utf-8 -*- + import collections + +-from nose.tools import eq_ +- + from purl.template import expand + + # Define variables as in the RFC (http://tools.ietf.org/html/rfc6570) +@@ -117,7 +115,7 @@ + + + def assert_expansion(template, fields, expected): +- eq_(expand(template, fields), expected) ++ assert expand(template, fields) == expected + + + def test_expansion(): +diff -ru a/tox.ini b/tox.ini +--- a/tox.ini 2019-03-10 21:51:02.000000000 +0100 ++++ b/tox.ini 2020-05-04 14:30:03.975691441 +0200 +@@ -7,5 +7,5 @@ + envlist = py26, py27, py34, pypy + + [testenv] +-commands = nosetests [] ++commands = pytest + deps = -r{toxinidir}/requirements.txt