diff --git a/python-URLObject.changes b/python-URLObject.changes index 024d0d4..84cbb65 100644 --- a/python-URLObject.changes +++ b/python-URLObject.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 5 14:37:28 UTC 2020 - Matej Cepl + +- Add remove_nose.patch replacing use of nose with the standard + library. + ------------------------------------------------------------------- Thu Nov 7 16:03:18 UTC 2019 - Matej Cepl diff --git a/python-URLObject.spec b/python-URLObject.spec index b526493..f65b4eb 100644 --- a/python-URLObject.spec +++ b/python-URLObject.spec @@ -1,7 +1,7 @@ # # spec file for package python-URLObject # -# 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 @@ -24,12 +24,15 @@ Summary: Python library for manipulating URLs (and some URIs) in a more n License: SUSE-Public-Domain URL: https://github.com/zacharyvoase/urlobject Source: https://files.pythonhosted.org/packages/source/U/URLObject/URLObject-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM remove_nose.patch bsc#[0-9]+ mcepl@suse.com +# Remove the need for nose and use the standard library. +Patch0: remove_nose.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module nose} +BuildRequires: %{python_module pytest} # /SECTION %python_subpackages @@ -51,7 +54,7 @@ test-driven manner, and has full Sphinx documentation. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand nosetests-%{$python_bin_suffix} +%pytest %files %{python_files} %doc README.rst diff --git a/remove_nose.patch b/remove_nose.patch new file mode 100644 index 0000000..21ea38e --- /dev/null +++ b/remove_nose.patch @@ -0,0 +1,41 @@ +--- a/test/netloc_test.py ++++ b/test/netloc_test.py +@@ -1,7 +1,5 @@ + import unittest + +-from nose.tools import assert_raises +- + from urlobject.netloc import Netloc + + +@@ -49,8 +47,8 @@ class NetlocTest(unittest.TestCase): + 'zack:5678@github.com:443') + + def test_with_password_on_a_netloc_with_no_username_raises_ValueError(self): +- assert_raises(ValueError, +- lambda: Netloc('github.com').with_password('1234')) ++ with self.assertRaises(ValueError): ++ Netloc('github.com').with_password('1234') + + def test_with_auth_with_one_arg_adds_username(self): + assert (Netloc('github.com').with_auth('zack') == +--- a/test/urlobject_test.py ++++ b/test/urlobject_test.py +@@ -2,7 +2,6 @@ import platform + import doctest + import unittest + +-from nose.tools import assert_raises + from urlobject import urlobject as urlobject_module + from urlobject import URLObject + from urlobject.six import text_type, u, print_ +@@ -188,7 +187,8 @@ class URLObjectModificationTest(unittest + + def test_with_password_raises_ValueError_when_there_is_no_username(self): + url = URLObject('https://github.com/') +- assert_raises(ValueError, lambda: url.with_password('1234')) ++ with self.assertRaises(ValueError): ++ url.with_password('1234') + + def test_with_password_replaces_password(self): + url = URLObject('https://zack:1234@github.com/')