15
0

- Add remove_nose.patch replacing use of nose with the standard

library.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-URLObject?expand=0&rev=10
This commit is contained in:
2020-06-05 14:38:14 +00:00
committed by Git OBS Bridge
parent b6b8f0f398
commit 1373cd5ea6
3 changed files with 53 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 5 14:37:28 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add remove_nose.patch replacing use of nose with the standard
library.
-------------------------------------------------------------------
Thu Nov 7 16:03:18 UTC 2019 - Matej Cepl <mcepl@suse.com>

View File

@@ -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

41
remove_nose.patch Normal file
View File

@@ -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/')