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: Mon, 02 Nov 2015 11:50:58
Message-Id: 1446464832.0acc7960a2faa355787c072d073a891c2ac2c7a6.jlec@gentoo
1 commit: 0acc7960a2faa355787c072d073a891c2ac2c7a6
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 2 08:06:32 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 2 11:47:12 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0acc7960
7
8 dev-python/testrepository: Backport test fixes
9
10 Package-Manager: portage-2.2.23
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 .../testrepository-0.0.20-test-backport.patch | 71 ++++++++++++++++++++++
14 .../testrepository-0.0.20-test-backport1.patch | 22 +++++++
15 .../testrepository/testrepository-0.0.20.ebuild | 6 +-
16 3 files changed, 97 insertions(+), 2 deletions(-)
17
18 diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch
19 new file mode 100644
20 index 0000000..7622c0a
21 --- /dev/null
22 +++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch
23 @@ -0,0 +1,71 @@
24 +From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001
25 +From: Robert Collins <robertc@×××××××××××××.net>
26 +Date: Tue, 10 Mar 2015 15:21:49 +1300
27 +Subject: [PATCH] Fixup tests with latest testtools.
28 +
29 +Testtools has started chunking exceptions (which is perhaps good,
30 +perhaps bad) - but we shouldn't depend on the exact behaviour in it
31 +for our tests.
32 +---
33 + NEWS | 6 ++++++
34 + testrepository/tests/test_repository.py | 14 ++++++++++----
35 + 2 files changed, 16 insertions(+), 4 deletions(-)
36 +
37 +diff --git a/NEWS b/NEWS
38 +index e258b11..536308c 100644
39 +--- a/NEWS
40 ++++ b/NEWS
41 +@@ -5,6 +5,12 @@ testrepository release notes
42 + NEXT (In development)
43 + +++++++++++++++++++++
44 +
45 ++CHANGES
46 ++-------
47 ++
48 ++* Isolate the testrepository test suite from the chunking (or otherwise)
49 ++ behaviour of testtools' exception handlers. (Robert Collins)
50 ++
51 + 0.0.20
52 + ++++++
53 +
54 +diff --git a/testrepository/tests/test_repository.py b/testrepository/tests/test_repository.py
55 +index e2e5e05..4a8667b 100644
56 +--- a/testrepository/tests/test_repository.py
57 ++++ b/testrepository/tests/test_repository.py
58 +@@ -28,6 +28,7 @@
59 + from testresources import TestResource
60 + from testtools import (
61 + clone_test_with_new_id,
62 ++ content,
63 + PlaceHolder,
64 + )
65 + import testtools
66 +@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
67 + def passing(self):
68 + pass
69 +
70 +- def failing(self):
71 +- self.fail("oops")
72 +-
73 + def unexpected_success(self):
74 + self.expectFailure("unexpected success", self.assertTrue, True)
75 +
76 +
77 ++class FailingCase:
78 ++
79 ++ def run(self, result):
80 ++ result.startTest(self)
81 ++ result.addError(
82 ++ self, None, details={'traceback': content.text_content("")})
83 ++ result.stopTest(self)
84 ++
85 + def make_test(id, should_pass):
86 + """Make a test."""
87 + if should_pass:
88 + case = Case("passing")
89 + else:
90 +- case = Case("failing")
91 ++ case = FailingCase()
92 + return clone_test_with_new_id(case, id)
93 +
94 +
95
96 diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch
97 new file mode 100644
98 index 0000000..193b91e
99 --- /dev/null
100 +++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch
101 @@ -0,0 +1,22 @@
102 +From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001
103 +From: Robert Collins <robertc@×××××××××××××.net>
104 +Date: Sun, 12 Jul 2015 21:37:34 +1200
105 +Subject: [PATCH] Fix 3.3+ tests with nested classnames.
106 +
107 +---
108 + testrepository/tests/ui/test_cli.py | 2 +-
109 + 1 file changed, 1 insertion(+), 1 deletion(-)
110 +
111 +diff --git a/testrepository/tests/ui/test_cli.py b/testrepository/tests/ui/test_cli.py
112 +index 9ba11ad..e1f9b44 100644
113 +--- a/testrepository/tests/ui/test_cli.py
114 ++++ b/testrepository/tests/ui/test_cli.py
115 +@@ -157,7 +157,7 @@ def method(self):
116 + self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'),
117 + DocTestMatches("""\
118 + ======================================================================
119 +-FAIL: testrepository.tests.ui.test_cli.Case.method
120 ++FAIL: testrepository.tests.ui.test_cli...Case.method
121 + ----------------------------------------------------------------------
122 + ...Traceback (most recent call last):...
123 + File "...test_cli.py", line ..., in method
124
125 diff --git a/dev-python/testrepository/testrepository-0.0.20.ebuild b/dev-python/testrepository/testrepository-0.0.20.ebuild
126 index e1dba2e..f9e9774 100644
127 --- a/dev-python/testrepository/testrepository-0.0.20.ebuild
128 +++ b/dev-python/testrepository/testrepository-0.0.20.ebuild
129 @@ -34,8 +34,10 @@ DEPEND="
130 # Required for test phase
131 DISTUTILS_IN_SOURCE_BUILD=1
132
133 -# https://github.com/testing-cabal/testrepository/issues/18
134 -RESTRICT=test
135 +PATCHES=(
136 + "${FILESDIR}"/${P}-test-backport.patch
137 + "${FILESDIR}"/${P}-test-backport1.patch
138 +)
139
140 python_test() {
141 # some errors appear to have crept in the suite undert py3 since addition.