Hello community, here is the log from the commit of package python-xcffib for openSUSE:Factory checked in at 2019-06-22 11:23:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-xcffib (Old) and /work/SRC/openSUSE:Factory/.python-xcffib.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xcffib" Sat Jun 22 11:23:08 2019 rev:6 rq:710345 version:0.8.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-xcffib/python-xcffib.changes 2019-05-07 23:12:49.564145684 +0200 +++ /work/SRC/openSUSE:Factory/.python-xcffib.new.4615/python-xcffib.changes 2019-06-22 11:23:12.681324021 +0200 @@ -1,0 +2,6 @@ +Mon Jun 17 12:07:45 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.8.1: + * Testsuite expansion mostly + +------------------------------------------------------------------- Old: ---- xcffib-0.8.0.tar.gz New: ---- xcffib-0.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-xcffib.spec ++++++ --- /var/tmp/diff_new_pack.wM50gu/_old 2019-06-22 11:23:15.233326802 +0200 +++ /var/tmp/diff_new_pack.wM50gu/_new 2019-06-22 11:23:15.261326833 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-xcffib -Version: 0.8.0 +Version: 0.8.1 Release: 0 Summary: A drop in replacement for xpyb, an XCB python binding License: Apache-2.0 @@ -26,6 +26,7 @@ URL: http://github.com/tych0/xcffib Source: https://files.pythonhosted.org/packages/source/x/xcffib/xcffib-%{version}.tar.gz BuildRequires: %{python_module cffi >= 1.1.0} +BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes @@ -36,7 +37,6 @@ Requires: python-cffi >= 1.1.0 Requires: python-six BuildArch: noarch -BuildRequires: %{python_module nose} %python_subpackages %description ++++++ xcffib-0.8.0.tar.gz -> xcffib-0.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/PKG-INFO new/xcffib-0.8.1/PKG-INFO --- old/xcffib-0.8.0/PKG-INFO 2019-05-04 23:06:20.000000000 +0200 +++ new/xcffib-0.8.1/PKG-INFO 2019-06-03 03:51:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: xcffib -Version: 0.8.0 +Version: 0.8.1 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/setup.py new/xcffib-0.8.1/setup.py --- old/xcffib-0.8.0/setup.py 2019-05-04 23:06:19.000000000 +0200 +++ new/xcffib-0.8.1/setup.py 2019-06-03 03:51:52.000000000 +0200 @@ -60,7 +60,7 @@ cffi_modules=["xcffib/ffi_build.py:ffi"] ) -version = "0.8.0" +version = "0.8.1" dependencies = ['six', requires_cffi] setup( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/test/test_python_code.py new/xcffib-0.8.1/test/test_python_code.py --- old/xcffib-0.8.0/test/test_python_code.py 2018-10-11 23:32:44.000000000 +0200 +++ new/xcffib-0.8.1/test/test_python_code.py 2019-06-03 03:29:43.000000000 +0200 @@ -15,6 +15,7 @@ import xcffib import xcffib.xproto +import os import struct import sys from xcffib.xproto import EventMask @@ -139,3 +140,18 @@ reply = self.conn.core.GetImage( output_format, root, 0, 0, width, height, plane_mask).reply() reply.data.buf() + + +class TestXcffibTestGenerator(object): + + def test_XcffibTest_generator(self): + old_display = os.environ['DISPLAY'] + # use some non-default width/height + with XcffibTest(width=1001, height=502) as test: + assert os.environ['DISPLAY'] != old_display + setup = test.conn.get_setup() + screen = setup.roots[0] + width = screen.width_in_pixels + height = screen.height_in_pixels + assert width == 1001 + assert height == 502 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/xcffib/__init__.py new/xcffib-0.8.1/xcffib/__init__.py --- old/xcffib-0.8.0/xcffib/__init__.py 2019-05-04 23:06:19.000000000 +0200 +++ new/xcffib-0.8.1/xcffib/__init__.py 2019-06-03 03:51:52.000000000 +0200 @@ -38,7 +38,7 @@ lib = ffi.dlopen(soname) __xcb_proto_version__ = "1.13" -__version__ = "0.8.0" +__version__ = "0.8.1" X_PROTOCOL = lib.X_PROTOCOL X_PROTOCOL_REVISION = lib.X_PROTOCOL_REVISION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/xcffib/testing.py new/xcffib-0.8.1/xcffib/testing.py --- old/xcffib-0.8.0/xcffib/testing.py 2019-05-03 23:53:26.000000000 +0200 +++ new/xcffib-0.8.1/xcffib/testing.py 2019-06-03 03:51:52.000000000 +0200 @@ -27,6 +27,14 @@ return '/tmp/.X%d-lock' % display +def find_display(): + display = 10 + while True: + if not os.path.exists(lock_path(display)): + return display + display += 1 + + class XvfbTest(object): """ A helper class for testing things with nosetests. This class will run @@ -37,16 +45,17 @@ # test. xtrace = False + def __init__(self, width=800, height=600, depth=16): + self.width = width + self.height = height + self.depth = depth + def spawn(self, cmd): """ Spawn a command but swallow its output. """ discard = open(os.devnull) return subprocess.Popen(cmd, stdout=discard, stderr=discard) def setUp(self): - self.width = 800 - self.height = 600 - self.depth = 16 - self._old_display = os.environ.get('DISPLAY') os.environ['DISPLAY'] = ':%d' % self._find_display() self._xvfb = self.spawn(self._xvfb_command()) @@ -86,6 +95,13 @@ else: os.environ['DISPLAY'] = self._old_display + def __enter__(self): + self.setUp() + return self + + def __exit__(self, type, value, traceback): + self.tearDown() + def _xvfb_command(self): """ You can override this if you have some extra args for Xvfb or whatever. At this point, os.environ['DISPLAY'] is set to something Xvfb @@ -108,8 +124,5 @@ # Don't do this for every test. if hasattr(self, '_display'): return self._display - self._display = 10 - while True: - if not os.path.exists(lock_path(self._display)): - return self._display - self._display += 1 + self._display = find_display() + return self._display diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-0.8.0/xcffib.egg-info/PKG-INFO new/xcffib-0.8.1/xcffib.egg-info/PKG-INFO --- old/xcffib-0.8.0/xcffib.egg-info/PKG-INFO 2019-05-04 23:06:20.000000000 +0200 +++ new/xcffib-0.8.1/xcffib.egg-info/PKG-INFO 2019-06-03 03:51:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: xcffib -Version: 0.8.0 +Version: 0.8.1 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen
