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 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
From: =?utf-8?q?Jakub_Kul=C3=ADk?= <kulikjak@gmail.com>
Date: Wed, 13 Nov 2024 09:52:33 +0100
Subject: Fix test suite for release 1.9.0
---
tests/test_pyperclip.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tests/test_pyperclip.py b/tests/test_pyperclip.py
index cf31b56..5300785 100644
--- a/tests/test_pyperclip.py
+++ b/tests/test_pyperclip.py
@@ -8,7 +8,7 @@ import platform
#import sys
#sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
-from pyperclip import _executable_exists, HAS_DISPLAY
+from pyperclip import _executable_exists
from pyperclip import (init_osx_pbcopy_clipboard, init_osx_pyobjc_clipboard,
init_dev_clipboard_clipboard,
init_qt_clipboard,
@@ -99,12 +99,11 @@ class _TestClipboard(unittest.TestCase):
self.copy(False)
self.assertEqual(self.paste(), 'False')
- # All other non-str values raise an exception.
- with self.assertRaises(PyperclipException):
- self.copy(None)
+ self.copy(None)
+ self.assertEqual(self.paste(), 'None')
- with self.assertRaises(PyperclipException):
- self.copy([2, 4, 6, 8])
+ self.copy([2, 4, 6, 8])
+ self.assertEqual(self.paste(), '[2, 4, 6, 8]')
class TestCygwin(_TestClipboard):
@@ -135,7 +134,7 @@ class TestOSX(_TestClipboard):
class TestQt(_TestClipboard):
- if HAS_DISPLAY:
+ if os.getenv("DISPLAY"):
try:
import PyQt5.QtWidgets
except ImportError:
|