Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/testrepository/, dev-python/testrepository/files/
Date: Tue, 03 Nov 2015 12:17:33
Message-Id: 1446553019.ebc0f971f94ce78032b4bf3a20c3a9bce60095ee.jlec@gentoo
1 commit: ebc0f971f94ce78032b4bf3a20c3a9bce60095ee
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 3 12:13:42 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 3 12:16:59 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebc0f971
7
8 dev-python/testrepository: Backport test fixes
9
10 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=537536
11
12 Package-Manager: portage-2.2.23
13 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
14
15 .../testrepository-0.0.18-test-backport.patch | 41 ++++++++++++++++++++++
16 .../testrepository/testrepository-0.0.18-r1.ebuild | 8 ++++-
17 2 files changed, 48 insertions(+), 1 deletion(-)
18
19 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
20 new file mode 100644
21 index 0000000..112b029
22 --- /dev/null
23 +++ b/dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch
24 @@ -0,0 +1,41 @@
25 +diff --git a/testrepository/tests/test_repository.py b/testrepository/tests/test_repository.py
26 +index e2e5e05..4a8667b 100644
27 +--- a/testrepository/tests/test_repository.py
28 ++++ b/testrepository/tests/test_repository.py
29 +@@ -28,6 +28,7 @@
30 + from testresources import TestResource
31 + from testtools import (
32 + clone_test_with_new_id,
33 ++ content,
34 + PlaceHolder,
35 + )
36 + import testtools
37 +@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
38 + def passing(self):
39 + pass
40 +
41 +- def failing(self):
42 +- self.fail("oops")
43 +-
44 + def unexpected_success(self):
45 + self.expectFailure("unexpected success", self.assertTrue, True)
46 +
47 +
48 ++class FailingCase:
49 ++
50 ++ def run(self, result):
51 ++ result.startTest(self)
52 ++ result.addError(
53 ++ self, None, details={'traceback': content.text_content("")})
54 ++ result.stopTest(self)
55 ++
56 + def make_test(id, should_pass):
57 + """Make a test."""
58 + if should_pass:
59 + case = Case("passing")
60 + else:
61 +- case = Case("failing")
62 ++ case = FailingCase()
63 + return clone_test_with_new_id(case, id)
64 +
65 +
66
67 diff --git a/dev-python/testrepository/testrepository-0.0.18-r1.ebuild b/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
68 index 3771a41..0b287e8 100644
69 --- a/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
70 +++ b/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
71 @@ -34,9 +34,15 @@ DEPEND="
72 # Required for test phase
73 DISTUTILS_IN_SOURCE_BUILD=1
74
75 +PATCHES=(
76 + "${FILESDIR}"/${P}-test-backport.patch
77 + "${FILESDIR}"/${PN}-0.0.20-test-backport1.patch
78 +)
79 +
80 python_test() {
81 # some errors appear to have crept in the suite undert py3 since addition.
82 # Python2.7 now passes all.
83
84 - esetup.py testr --coverage
85 + ${PYTHON} testr init || die
86 + ${PYTHON} testr run || die
87 }