diff options
author | Justin Lecher <jlec@gentoo.org> | 2015-11-02 09:06:32 +0100 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2015-11-02 12:47:12 +0100 |
commit | 0acc7960a2faa355787c072d073a891c2ac2c7a6 (patch) | |
tree | 479b7557bb834b1a8db5731f381534d599956ac1 | |
parent | dev-python/CacheControl: Restrict tests bacause they are not included (diff) | |
download | gentoo-0acc7960a2faa355787c072d073a891c2ac2c7a6.tar.gz gentoo-0acc7960a2faa355787c072d073a891c2ac2c7a6.tar.bz2 gentoo-0acc7960a2faa355787c072d073a891c2ac2c7a6.zip |
dev-python/testrepository: Backport test fixes
Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec@gentoo.org>
3 files changed, 97 insertions, 2 deletions
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 new file mode 100644 index 000000000000..7622c0abfa43 --- /dev/null +++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch @@ -0,0 +1,71 @@ +From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001 +From: Robert Collins <robertc@robertcollins.net> +Date: Tue, 10 Mar 2015 15:21:49 +1300 +Subject: [PATCH] Fixup tests with latest testtools. + +Testtools has started chunking exceptions (which is perhaps good, +perhaps bad) - but we shouldn't depend on the exact behaviour in it +for our tests. +--- + NEWS | 6 ++++++ + testrepository/tests/test_repository.py | 14 ++++++++++---- + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/NEWS b/NEWS +index e258b11..536308c 100644 +--- a/NEWS ++++ b/NEWS +@@ -5,6 +5,12 @@ testrepository release notes + NEXT (In development) + +++++++++++++++++++++ + ++CHANGES ++------- ++ ++* Isolate the testrepository test suite from the chunking (or otherwise) ++ behaviour of testtools' exception handlers. (Robert Collins) ++ + 0.0.20 + ++++++ + +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) + + 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 new file mode 100644 index 000000000000..193b91e1cd3d --- /dev/null +++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch @@ -0,0 +1,22 @@ +From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001 +From: Robert Collins <robertc@robertcollins.net> +Date: Sun, 12 Jul 2015 21:37:34 +1200 +Subject: [PATCH] Fix 3.3+ tests with nested classnames. + +--- + testrepository/tests/ui/test_cli.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testrepository/tests/ui/test_cli.py b/testrepository/tests/ui/test_cli.py +index 9ba11ad..e1f9b44 100644 +--- a/testrepository/tests/ui/test_cli.py ++++ b/testrepository/tests/ui/test_cli.py +@@ -157,7 +157,7 @@ def method(self): + self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'), + DocTestMatches("""\ + ====================================================================== +-FAIL: testrepository.tests.ui.test_cli.Case.method ++FAIL: testrepository.tests.ui.test_cli...Case.method + ---------------------------------------------------------------------- + ...Traceback (most recent call last):... + File "...test_cli.py", line ..., in method diff --git a/dev-python/testrepository/testrepository-0.0.20.ebuild b/dev-python/testrepository/testrepository-0.0.20.ebuild index e1dba2ec1e90..f9e97746ada3 100644 --- a/dev-python/testrepository/testrepository-0.0.20.ebuild +++ b/dev-python/testrepository/testrepository-0.0.20.ebuild @@ -34,8 +34,10 @@ DEPEND=" # Required for test phase DISTUTILS_IN_SOURCE_BUILD=1 -# https://github.com/testing-cabal/testrepository/issues/18 -RESTRICT=test +PATCHES=( + "${FILESDIR}"/${P}-test-backport.patch + "${FILESDIR}"/${P}-test-backport1.patch +) python_test() { # some errors appear to have crept in the suite undert py3 since addition. |