commit:     9a2c9c7b209a8dbf42b2698181b2bcf5d95dbdf5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 10 15:57:52 2020 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jun 10 15:59:02 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a2c9c7b

dev-python/automat: Fix test failures for bug 665554

automat _visualize.py code depends on both twisted and graphiz modules.
This patch fixes the condition where some tests were not skipped due
to twisted not being installed, but graphviz was.

Gentoo-bug: https://bugs.gentoo.org/665554
Upstream-PR: https://github.com/glyph/automat/pull/125
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 dev-python/automat/automat-0.8.0-r1.ebuild         |  3 +-
 dev-python/automat/automat-20.2.0.ebuild           |  3 +-
 .../test_visualize-twisted-import-errors.patch     | 52 ++++++++++++++++++++++
 3 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/dev-python/automat/automat-0.8.0-r1.ebuild 
b/dev-python/automat/automat-0.8.0-r1.ebuild
index d31a2e5ccc3..35f0f151aaf 100644
--- a/dev-python/automat/automat-0.8.0-r1.ebuild
+++ b/dev-python/automat/automat-0.8.0-r1.ebuild
@@ -32,6 +32,7 @@ S="${WORKDIR}/${MY_P}"
 
 PATCHES=(
        "${FILESDIR}/automat-0.8.0-no-setup-py-m2r-import.patch"
+       "${FILESDIR}/test_visualize-twisted-import-errors.patch"
 )
 
 distutils_enable_tests pytest
@@ -59,7 +60,7 @@ python_install_all() {
 }
 
 pkg_postinst() {
-       einfo "For additional visualization functionality install these 
optional dependencies"
+       einfo "For additional visualization functionality install both these 
optional dependencies"
        einfo "    >=dev-python/twisted-16.1.1"
        einfo "    media-gfx/graphviz[python]"
 }

diff --git a/dev-python/automat/automat-20.2.0.ebuild 
b/dev-python/automat/automat-20.2.0.ebuild
index d07dff71307..dc4053b4c83 100644
--- a/dev-python/automat/automat-20.2.0.ebuild
+++ b/dev-python/automat/automat-20.2.0.ebuild
@@ -32,6 +32,7 @@ S="${WORKDIR}/${MY_P}"
 
 PATCHES=(
        "${FILESDIR}/automat-0.8.0-no-setup-py-m2r-import.patch"
+       "${FILESDIR}/test_visualize-twisted-import-errors.patch"
 )
 
 distutils_enable_tests pytest
@@ -59,7 +60,7 @@ python_install_all() {
 }
 
 pkg_postinst() {
-       einfo "For additional visualization functionality install these 
optional dependencies"
+       einfo "For additional visualization functionality install both these 
optional dependencies"
        einfo "    >=dev-python/twisted-16.1.1"
        einfo "    media-gfx/graphviz[python]"
 }

diff --git 
a/dev-python/automat/files/test_visualize-twisted-import-errors.patch 
b/dev-python/automat/files/test_visualize-twisted-import-errors.patch
new file mode 100644
index 00000000000..b3d8938cf7d
--- /dev/null
+++ b/dev-python/automat/files/test_visualize-twisted-import-errors.patch
@@ -0,0 +1,52 @@
+From 9f6312e0c2504c27b72bb228a37ed5ac58776e94 Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <[email protected]>
+Date: Wed, 10 Jun 2020 07:31:45 -0700
+Subject: [PATCH] Fix _test_visualize.py twisted import errors
+
+When graphviz modules are installed but not twisted, this creates test failures
+in _discover.py which hard depends on twisted being installed.
+
+Signed-off-by: Brian Dolbec <[email protected]>
+---
+ automat/_test/test_visualize.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/automat/_test/test_visualize.py b/automat/_test/test_visualize.py
+index 987eb3c..142c4bf 100644
+--- a/automat/_test/test_visualize.py
++++ b/automat/_test/test_visualize.py
+@@ -62,6 +62,7 @@ def sampleMachine():
+ 
+ 
+ @skipIf(not isGraphvizModuleInstalled(), "Graphviz module is not installed.")
++@skipIf(not isTwistedInstalled(), "Twisted is not installed.")
+ class ElementMakerTests(TestCase):
+     """
+     L{elementMaker} generates HTML representing the specified element.
+@@ -134,6 +135,7 @@ def isLeaf(element):
+ 
+ 
+ @skipIf(not isGraphvizModuleInstalled(), "Graphviz module is not installed.")
++@skipIf(not isTwistedInstalled(), "Twisted is not installed.")
+ class TableMakerTests(TestCase):
+     """
+     Tests that ensure L{tableMaker} generates HTML tables usable as
+@@ -214,6 +216,7 @@ class TableMakerTests(TestCase):
+ 
+ @skipIf(not isGraphvizModuleInstalled(), "Graphviz module is not installed.")
+ @skipIf(not isGraphvizInstalled(), "Graphviz tools are not installed.")
++@skipIf(not isTwistedInstalled(), "Twisted is not installed.")
+ class IntegrationTests(TestCase):
+     """
+     Tests which make sure Graphviz can understand the output produced by
+@@ -232,6 +235,7 @@ class IntegrationTests(TestCase):
+ 
+ 
+ @skipIf(not isGraphvizModuleInstalled(), "Graphviz module is not installed.")
++@skipIf(not isTwistedInstalled(), "Twisted is not installed.")
+ class SpotChecks(TestCase):
+     """
+     Tests to make sure that the output contains salient features of the 
machine
+--
+libgit2 0.99.0
+

Reply via email to