dev-python/testrepository: Backport test fixes
authorJustin Lecher <jlec@gentoo.org>
Tue, 3 Nov 2015 12:13:42 +0000 (13:13 +0100)
committerJustin Lecher <jlec@gentoo.org>
Tue, 3 Nov 2015 12:16:59 +0000 (13:16 +0100)
Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=537536

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec@gentoo.org>
dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch [new file with mode: 0644]
dev-python/testrepository/testrepository-0.0.18-r1.ebuild

diff --git a/dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch b/dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch
new file mode 100644 (file)
index 0000000..112b029
--- /dev/null
@@ -0,0 +1,41 @@
+diff --git a/testrepository/tests/test_repository.py b/testrepository/tests/test_repository.py
+index e2e5e05..4a8667b 100644
+--- a/testrepository/tests/test_repository.py
++++ b/testrepository/tests/test_repository.py
+@@ -28,6 +28,7 @@
+ from testresources import TestResource
+ from testtools import (
+     clone_test_with_new_id,
++    content,
+     PlaceHolder,
+     )
+ import testtools
+@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
+     def passing(self):
+         pass
+ 
+-    def failing(self):
+-        self.fail("oops")
+-
+     def unexpected_success(self):
+         self.expectFailure("unexpected success", self.assertTrue, True)
+ 
+ 
++class FailingCase:
++
++    def run(self, result):
++        result.startTest(self)
++        result.addError(
++            self, None, details={'traceback': content.text_content("")})
++        result.stopTest(self)
++
+ def make_test(id, should_pass):
+     """Make a test."""
+     if should_pass:
+         case = Case("passing")
+     else:
+-        case = Case("failing")
++        case = FailingCase()
+     return clone_test_with_new_id(case, id)
+ 
+ 
index 3771a4137fae7a269c3a55afbba83d21f2134c60..0b287e877a496a92cbe7f3ea7076615b1ffdc577 100644 (file)
@@ -34,9 +34,15 @@ DEPEND="
 # Required for test phase
 DISTUTILS_IN_SOURCE_BUILD=1
 
+PATCHES=(
+       "${FILESDIR}"/${P}-test-backport.patch
+       "${FILESDIR}"/${PN}-0.0.20-test-backport1.patch
+)
+
 python_test() {
        # some errors appear to have crept in the suite undert py3 since addition.
        # Python2.7 now passes all.
 
-       esetup.py testr --coverage
+       ${PYTHON} testr init || die
+       ${PYTHON} testr run || die
 }