Open mgorny opened 2 weeks ago
With the HAS_DISPLAY
removed:
--- pyperclip-1.9.0/tests/test_pyperclip.py.orig
+++ pyperclip-1.9.0/tests/test_pyperclip.py
@@ -8,7 +8,7 @@
#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,
@@ -134,16 +134,6 @@
clipboard = init_osx_pyobjc_clipboard()
-class TestQt(_TestClipboard):
- if HAS_DISPLAY:
- try:
- import PyQt5.QtWidgets
- except ImportError:
- pass
- else:
- clipboard = init_qt_clipboard()
-
-
class TestXClip(_TestClipboard):
if _executable_exists("xclip"):
clipboard = init_xclip_clipboard()
I see following two test failures:
FAIL: test_non_str (__main__.TestXClip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "$(BUILD_DIR)/tests/test_pyperclip.py", line 104, in test_non_str
self.copy(None)
AssertionError: PyperclipException not raised
======================================================================
FAIL: test_non_str (__main__.TestXSel)
----------------------------------------------------------------------
Traceback (most recent call last):
File "$(BUILD_DIR)/tests/test_pyperclip.py", line 104, in test_non_str
self.copy(None)
AssertionError: PyperclipException not raised
I was looking at updating python-pyperclip
in Fedora, and I followed exactly the same process – noticing that pyperclip.HAS_DISPLAY
was removed but the tests were not adapted, devising and testing the patch in https://github.com/asweigart/pyperclip/issues/263#issuecomment-2178394553, and encountering AssertionError: PyperclipException not raised
test failures (I also see the failure on tests/test_pyperclip.py::TestQt::test_non_str
).
…and indeed, there is no
HAS_DISPLAY
in it anymore.