Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #14230

Asking for help for python-xlib

From Emmanuel Arias <eamanu@yaerobi.com>
Newsgroups linux.debian.maint.python
Subject Asking for help for python-xlib
Date 2022-07-08 14:40 +0200
Message-ID <EGVr3-9Z8S-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello everybody,

I'm working on the new upstream release 0.31 and I'm looking for this 
bug [0].
But, I can not reproduce it. If I run in 0.29 and 0.31 the tests finish 
successfully,
but in [1] fails in different archs. Could you reproduce it? Could you 
give me some
advice/tips/clues about why I cannot reproduce it, please?

Anyway I created this patch, because I suspect that for some reason, the
self.display.flush() is raising the Exception before pytest can catch 
it, but
I don't think that is possible.

```
From: Emmanuel Arias <eamanu@yaerobi.com>
Date: Wed, 6 Jul 2022 18:10:50 -0300
Subject: Use context manager to avoid error in test.

Use context manager in tests to avoid an error during the Build in
Debian.

Bug-Debian: https://bugs.debian.org/1006033
---
  test/test_xlib_display.py | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/test_xlib_display.py b/test/test_xlib_display.py
index a41c53b..a2e31f3 100644
--- a/test/test_xlib_display.py
+++ b/test/test_xlib_display.py
@@ -52,8 +52,9 @@ class TestXlibDisplay(unittest.TestCase):
          self.assertEqual(str(self.display.display.socket_error), 
"Display connection closed by client")

      def test_can_close_display_and_check_for_error(self):
-        self.display.close()
-        self.assertRaises(Xlib.error.ConnectionClosedError, 
self.display.flush)
+        with self.assertRaises(Xlib.error.ConnectionClosedError):
+            self.display.close()
+            self.display.flush()

      def test_return_fileno(self):
          self.assertTrue(isinstance(self.display.fileno(), int))

```

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006033
[1] 
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/python-xlib.html

Thanks!
Cheers,
Emmanuel

Back to linux.debian.maint.python | Previous | Next | Find similar | Unroll thread


Thread

Asking for help for python-xlib Emmanuel Arias <eamanu@yaerobi.com> - 2022-07-08 14:40 +0200

csiph-web