dev-python/python-musicbrainz-ngs: python3.7 and fix test cases
authorGerion Entrup <entrup@sra.uni-hannover.de>
Fri, 12 Jul 2019 22:02:45 +0000 (00:02 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 16 Jul 2019 15:22:18 +0000 (17:22 +0200)
Closes: https://bugs.gentoo.org/689178
Closes: https://bugs.gentoo.org/653426
Package-Manager: Portage-2.3.66, Repoman-2.3.11
Signed-off-by: Gerion Entrup <gerion.entrup@flump.de>
Closes: https://github.com/gentoo/gentoo/pull/12436
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/python-musicbrainz-ngs/files/0.6-fix-test-submit.patch [new file with mode: 0644]
dev-python/python-musicbrainz-ngs/python-musicbrainz-ngs-0.6.ebuild

diff --git a/dev-python/python-musicbrainz-ngs/files/0.6-fix-test-submit.patch b/dev-python/python-musicbrainz-ngs/files/0.6-fix-test-submit.patch
new file mode 100644 (file)
index 0000000..4881936
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/test/test_submit.py b/test/test_submit.py
+index bce5362..2d13811 100644
+--- a/test/test_submit.py
++++ b/test/test_submit.py
+@@ -1,13 +1,23 @@
+ import unittest
+-import os
+-import sys
+-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+-
+ import musicbrainzngs
+ from musicbrainzngs import musicbrainz
+ from test import _common
++
+ class SubmitTest(unittest.TestCase):
++
++    def setUp(self):
++        self.orig_opener = musicbrainzngs.compat.build_opener
++        musicbrainz.set_useragent("test_client", "1.0")
++        musicbrainz.auth("user", "password")
++
++    def tearDown(self):
++        musicbrainzngs.compat.build_opener = self.orig_opener
++        musicbrainz._useragent = ""
++        musicbrainz._client = ""
++        musicbrainz.user = ""
++        musicbrainz.password = ""
++
+     def test_submit_tags(self):
+         self.opener = _common.FakeOpener("<response/>")
+         musicbrainzngs.compat.build_opener = lambda *args: self.opener
index 6dbb0b8902d695a1ef9dcb355c9f2d58aff70a0a..4c2de26e4996cb471d2ea7c66b8be1cbd67c22e0 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-PYTHON_COMPAT=( python{2_7,3_5,3_6} )
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
 
 inherit distutils-r1
 
@@ -20,6 +20,8 @@ IUSE="doc examples test"
 
 S="${WORKDIR}/${MY_PN}-${PV}"
 
+PATCHES="${FILESDIR}/0.6-fix-test-submit.patch"
+
 DEPEND="${RDEPEND}
        dev-python/setuptools[${PYTHON_USEDEP}]
        doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"