summaryrefslogtreecommitdiff
path: root/dev-python/pyperclip/files/pyperclip-1.7.0-test-pyqt.patch
blob: 4f1a94955f445bca7164e3e32e49d65099ab6d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From be59ac638e26aff5204a32333f7ebe046003065a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Tue, 9 Jun 2020 08:46:46 +0200
Subject: [PATCH] Make PyQt checks in tests more specific

Test whether the widgets module can be imported rather than 'PyQt?'
in general.  The latter gives false positives if PyQt is uninstalled
but there are leftover subpackages such as qscintilla.  In this case,
Python 3 imports 'PyQt?' as a namespace.
---
 tests/test_pyperclip.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_pyperclip.py b/tests/test_pyperclip.py
index 7519d94..2942639 100644
--- a/tests/test_pyperclip.py
+++ b/tests/test_pyperclip.py
@@ -146,10 +146,10 @@ class TestGtk(_TestClipboard):
 class TestQt(_TestClipboard):
     if HAS_DISPLAY:
         try:
-            import PyQt5
+            import PyQt5.QtWidgets
         except ImportError:
             try:
-                import PyQt4
+                import PyQt4.QtGui
             except ImportError:
                 pass
             else:
-- 
2.27.0