public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/testrepository/, dev-python/testrepository/files/
@ 2015-11-02 11:50 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2015-11-02 11:50 UTC (permalink / raw
  To: gentoo-commits

commit:     0acc7960a2faa355787c072d073a891c2ac2c7a6
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  2 08:06:32 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Nov  2 11:47:12 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0acc7960

dev-python/testrepository: Backport test fixes

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../testrepository-0.0.20-test-backport.patch      | 71 ++++++++++++++++++++++
 .../testrepository-0.0.20-test-backport1.patch     | 22 +++++++
 .../testrepository/testrepository-0.0.20.ebuild    |  6 +-
 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 0000000..7622c0a
--- /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 0000000..193b91e
--- /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 e1dba2e..f9e9774 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.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/testrepository/, dev-python/testrepository/files/
@ 2015-11-03 12:17 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2015-11-03 12:17 UTC (permalink / raw
  To: gentoo-commits

commit:     ebc0f971f94ce78032b4bf3a20c3a9bce60095ee
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  3 12:13:42 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Tue Nov  3 12:16:59 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebc0f971

dev-python/testrepository: Backport test fixes

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=537536

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../testrepository-0.0.18-test-backport.patch      | 41 ++++++++++++++++++++++
 .../testrepository/testrepository-0.0.18-r1.ebuild |  8 ++++-
 2 files changed, 48 insertions(+), 1 deletion(-)

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
index 0000000..112b029
--- /dev/null
+++ b/dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch
@@ -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)
+ 
+ 

diff --git a/dev-python/testrepository/testrepository-0.0.18-r1.ebuild b/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
index 3771a41..0b287e8 100644
--- a/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
+++ b/dev-python/testrepository/testrepository-0.0.18-r1.ebuild
@@ -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
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/testrepository/, dev-python/testrepository/files/
@ 2018-07-14 15:46 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2018-07-14 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     0cde98695d945cd046bd614535549b298cf1b768
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 14 15:38:13 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 14 15:46:00 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cde9869

dev-python/testrepository: Backport more test fixes

Closes: https://bugs.gentoo.org/648442

 .../testrepository-0.0.20-test-backport2.patch     | 61 ++++++++++++++++++++++
 .../testrepository/testrepository-0.0.20.ebuild    |  1 +
 2 files changed, 62 insertions(+)

diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch
new file mode 100644
index 00000000000..a0614b671e1
--- /dev/null
+++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch
@@ -0,0 +1,61 @@
+From e2f84ae6b2bcf89221613056d0c45dd308f46d62 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
+Date: Thu, 5 Apr 2018 01:02:40 +0100
+Subject: [PATCH] Fix the testrepository tests with newer versions of
+ testtools.
+
+---
+ testrepository/tests/commands/test_failing.py | 2 +-
+ testrepository/tests/test_repository.py       | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/testrepository/tests/commands/test_failing.py b/testrepository/tests/commands/test_failing.py
+index 56c97ef..4e52f6a 100644
+--- a/testrepository/tests/commands/test_failing.py
++++ b/testrepository/tests/commands/test_failing.py
+@@ -90,7 +90,7 @@ class TestCommand(ResourcedTestCase):
+         finally:
+             log.stopTestRun()
+         self.assertEqual(
+-            log._events, [
++            [tuple(ev) for ev in log._events], [
+             ('startTestRun',),
+             ('status', 'failing', 'inprogress', None, True, None, None, False,
+              None, None, Wildcard),
+diff --git a/testrepository/tests/test_repository.py b/testrepository/tests/test_repository.py
+index 4a8667b..28d99bc 100644
+--- a/testrepository/tests/test_repository.py
++++ b/testrepository/tests/test_repository.py
+@@ -113,9 +113,10 @@ class FailingCase:
+     def run(self, result):
+         result.startTest(self)
+         result.addError(
+-            self, None, details={'traceback': content.text_content("")})
++            self, None, details={'traceback': content.text_content("tb")})
+         result.stopTest(self)
+ 
++
+ def make_test(id, should_pass):
+     """Make a test."""
+     if should_pass:
+@@ -409,7 +410,7 @@ class TestRepositoryContract(ResourcedTestCase):
+         finally:
+             log.stopTestRun()
+         self.assertEqual(
+-            log._events, [
++            [tuple(ev) for ev in log._events], [
+             ('startTestRun',),
+             ('status',
+              'testrepository.tests.test_repository.Case.method',
+@@ -465,7 +466,7 @@ class TestRepositoryContract(ResourcedTestCase):
+         finally:
+             log.stopTestRun()
+         self.assertEqual(
+-            log._events,
++            [tuple(ev) for ev in log._events],
+             [
+             ('startTestRun',),
+             ('status',
+-- 
+2.18.0
+

diff --git a/dev-python/testrepository/testrepository-0.0.20.ebuild b/dev-python/testrepository/testrepository-0.0.20.ebuild
index 59fbcc1f08b..2c7ffaca0ff 100644
--- a/dev-python/testrepository/testrepository-0.0.20.ebuild
+++ b/dev-python/testrepository/testrepository-0.0.20.ebuild
@@ -37,6 +37,7 @@ DISTUTILS_IN_SOURCE_BUILD=1
 PATCHES=(
 	"${FILESDIR}"/${P}-test-backport.patch
 	"${FILESDIR}"/${P}-test-backport1.patch
+	"${FILESDIR}"/${P}-test-backport2.patch
 )
 
 python_test() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-14 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 11:50 [gentoo-commits] repo/gentoo:master commit in: dev-python/testrepository/, dev-python/testrepository/files/ Justin Lecher
  -- strict thread matches above, loose matches on Subject: below --
2015-11-03 12:17 Justin Lecher
2018-07-14 15:46 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox