Hello community,
here is the log from the commit of package python-pytest-xvfb for
openSUSE:Factory checked in at 2018-04-19 15:29:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-xvfb (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-xvfb.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-xvfb"
Thu Apr 19 15:29:26 2018 rev:2 rq:597312 version:1.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-xvfb/python-pytest-xvfb.changes
2017-08-30 16:22:20.704732184 +0200
+++
/work/SRC/openSUSE:Factory/.python-pytest-xvfb.new/python-pytest-xvfb.changes
2018-04-19 15:29:26.603166354 +0200
@@ -1,0 +2,11 @@
+Sun Apr 15 18:54:38 UTC 2018 - [email protected]
+
+- specfile:
+ * update copyright year
+ * always run tests
+
+- update to version 1.1.0:
+ * The xvfb_args option is now a single line parsed with shlex.split.
+ * The XvfbExitedError exception now includes stdout and stderr.
+
+-------------------------------------------------------------------
Old:
----
pytest-xvfb-1.0.0.tar.gz
New:
----
pytest-xvfb-1.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-xvfb.spec ++++++
--- /var/tmp/diff_new_pack.xGwpbe/_old 2018-04-19 15:29:27.175142935 +0200
+++ /var/tmp/diff_new_pack.xGwpbe/_new 2018-04-19 15:29:27.179142772 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-xvfb
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,25 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_with test
Name: python-pytest-xvfb
-Version: 1.0.0
+Version: 1.1.0
Release: 0
Summary: Pytest plugin to run Xvfb for tests
License: MIT
Group: Development/Languages/Python
-Url: https://github.com/The-Compiler/pytest-xvfb
+URL: https://github.com/The-Compiler/pytest-xvfb
Source:
https://files.pythonhosted.org/packages/source/p/pytest-xvfb/pytest-xvfb-%{version}.tar.gz
+BuildRequires: %{python_module PyVirtualDisplay >= 0.2.1}
BuildRequires: %{python_module devel}
+BuildRequires: %{python_module pytest >= 2.8.1}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-%if %{with test}
-BuildRequires: %{python_module PyVirtualDisplay >= 0.2.1}
-BuildRequires: %{python_module pytest >= 2.8.1}
BuildRequires: xorg-x11-server
-%endif
Requires: python-PyVirtualDisplay >= 0.2.1
Requires: python-pytest >= 2.8.1
Recommends: xorg-x11-server
BuildArch: noarch
-
%python_subpackages
%description
@@ -67,13 +63,11 @@
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
-%if %{with test}
%check
%python_exec setup.py test
-%endif
%files %{python_files}
-%defattr(-,root,root,-)
+%license LICENSE
%doc README.rst
%{python_sitelib}/*
++++++ pytest-xvfb-1.0.0.tar.gz -> pytest-xvfb-1.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/.gitignore
new/pytest-xvfb-1.1.0/.gitignore
--- old/pytest-xvfb-1.0.0/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/.gitignore 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,9 @@
+/.cache
+/*.egg-info
+/__pycache__
+/.tox
+/dist
+/htmlcov
+/coverage.xml
+/.coverage
+*.pyc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/.travis.yml
new/pytest-xvfb-1.1.0/.travis.yml
--- old/pytest-xvfb-1.0.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/.travis.yml 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,27 @@
+# Config file for automatic testing at travis-ci.org
+
+sudo: false
+language: python
+python:
+ - "2.7"
+ - "3.3"
+ - "3.4"
+ - "3.5"
+ - "pypy"
+
+addons:
+ apt:
+ packages:
+ - xvfb
+ - xauth
+
+install:
+ - pip install tox
+ - "TOX_ENV=${TRAVIS_PYTHON_VERSION/[0-9].[0-9]/py${TRAVIS_PYTHON_VERSION/.}}"
+script: tox -e $TOX_ENV
+
+before_cache:
+ - rm -rf $HOME/.cache/pip/log
+cache:
+ directories:
+ - $HOME/.cache/pip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/CHANGELOG.rst
new/pytest-xvfb-1.1.0/CHANGELOG.rst
--- old/pytest-xvfb-1.0.0/CHANGELOG.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/CHANGELOG.rst 2018-02-07 09:30:31.000000000 +0100
@@ -0,0 +1,39 @@
+pytest-xvfb changelog
+=====================
+
+v1.1.0
+------
+
+- The ``xvfb_args`` option is now a single line parsed with ``shlex.split``.
+- The ``XvfbExitedError`` exception now includes stdout and stderr.
+
+v1.0.0
+------
+
+- Use `PyVirtualDisplay`_ to start/stop Xvfb
+- Show a warning on Linux if Xvfb is unavailable
+
+.. _PyVirtualDisplay: https://pypi.python.org/pypi/PyVirtualDisplay
+
+v0.3.0
+------
+
+- Add a new ``xvfb_xauth`` setting which creates an ``XAUTHORITY`` file.
+
+v0.2.1
+------
+
+- The temporary directory searched for logfiles is now hardcoded to /tmp
+ as that's what X11 does as well.
+
+v0.2.0
+------
+
+- The ``no_xvfb``-marker is now registered automatically so pytest doesn't fail
+ when run with ``--strict``.
+- The ``xvfb`` fixture is now session-scoped.
+
+v0.1.0
+------
+
+- Initial release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/LICENSE
new/pytest-xvfb-1.1.0/LICENSE
--- old/pytest-xvfb-1.0.0/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/LICENSE 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Florian Bruhin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/MANIFEST.in
new/pytest-xvfb-1.1.0/MANIFEST.in
--- old/pytest-xvfb-1.0.0/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/MANIFEST.in 2018-02-07 09:30:20.000000000 +0100
@@ -0,0 +1,2 @@
+include CHANGELOG.rst
+recursive-include tests *.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/PKG-INFO
new/pytest-xvfb-1.1.0/PKG-INFO
--- old/pytest-xvfb-1.0.0/PKG-INFO 2016-11-30 13:08:15.000000000 +0100
+++ new/pytest-xvfb-1.1.0/PKG-INFO 2018-02-07 09:31:37.000000000 +0100
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: pytest-xvfb
-Version: 1.0.0
+Version: 1.1.0
Summary: A pytest plugin to run Xvfb for tests.
Home-page: https://github.com/The-Compiler/pytest-xvfb
Author: Florian Bruhin
Author-email: [email protected]
License: MIT
+Description-Content-Type: UNKNOWN
Description: pytest-xvfb
===================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/appveyor.yml
new/pytest-xvfb-1.1.0/appveyor.yml
--- old/pytest-xvfb-1.0.0/appveyor.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/appveyor.yml 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,41 @@
+# What Python version is installed where:
+# http://www.appveyor.com/docs/installed-software#python
+
+environment:
+ matrix:
+ - PYTHON: "C:\\Python27"
+ TOX_ENV: "py27"
+
+ - PYTHON: "C:\\Python33"
+ TOX_ENV: "py33"
+
+ - PYTHON: "C:\\Python34"
+ TOX_ENV: "py34"
+
+ - PYTHON: "C:\\Python35"
+ TOX_ENV: "py35"
+
+
+init:
+ - "%PYTHON%/python -V"
+ - "%PYTHON%/python -c \"import struct;print( 8 * struct.calcsize(\'P\'))\""
+
+install:
+ - "%PYTHON%/Scripts/easy_install -U pip"
+ - "%PYTHON%/Scripts/pip install tox"
+ - "%PYTHON%/Scripts/pip install wheel"
+
+build: false # Not a C# project, build stuff at the test step instead.
+
+test_script:
+ - "%PYTHON%/Scripts/tox -e %TOX_ENV% -- tests/test_xvfb_windows.py"
+
+after_test:
+ - "%PYTHON%/python setup.py bdist_wheel"
+ - ps: "ls dist"
+
+artifacts:
+ - path: dist\*
+
+#on_success:
+# - TODO: upload the content of dist/*.whl to a public wheelhouse
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/pytest.ini
new/pytest-xvfb-1.1.0/pytest.ini
--- old/pytest-xvfb-1.0.0/pytest.ini 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/pytest.ini 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,2 @@
+[pytest]
+addopts = --runpytest=subprocess
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/pytest_xvfb.egg-info/PKG-INFO
new/pytest-xvfb-1.1.0/pytest_xvfb.egg-info/PKG-INFO
--- old/pytest-xvfb-1.0.0/pytest_xvfb.egg-info/PKG-INFO 2016-11-30
13:08:15.000000000 +0100
+++ new/pytest-xvfb-1.1.0/pytest_xvfb.egg-info/PKG-INFO 2018-02-07
09:31:37.000000000 +0100
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: pytest-xvfb
-Version: 1.0.0
+Version: 1.1.0
Summary: A pytest plugin to run Xvfb for tests.
Home-page: https://github.com/The-Compiler/pytest-xvfb
Author: Florian Bruhin
Author-email: [email protected]
License: MIT
+Description-Content-Type: UNKNOWN
Description: pytest-xvfb
===================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/pytest_xvfb.egg-info/SOURCES.txt
new/pytest-xvfb-1.1.0/pytest_xvfb.egg-info/SOURCES.txt
--- old/pytest-xvfb-1.0.0/pytest_xvfb.egg-info/SOURCES.txt 2016-11-30
13:08:15.000000000 +0100
+++ new/pytest-xvfb-1.1.0/pytest_xvfb.egg-info/SOURCES.txt 2018-02-07
09:31:37.000000000 +0100
@@ -1,9 +1,20 @@
+.gitignore
+.travis.yml
+CHANGELOG.rst
+LICENSE
+MANIFEST.in
README.rst
+appveyor.yml
+pytest.ini
pytest_xvfb.py
setup.py
+tox.ini
pytest_xvfb.egg-info/PKG-INFO
pytest_xvfb.egg-info/SOURCES.txt
pytest_xvfb.egg-info/dependency_links.txt
pytest_xvfb.egg-info/entry_points.txt
pytest_xvfb.egg-info/requires.txt
-pytest_xvfb.egg-info/top_level.txt
\ No newline at end of file
+pytest_xvfb.egg-info/top_level.txt
+tests/conftest.py
+tests/test_xvfb.py
+tests/test_xvfb_windows.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/pytest_xvfb.py
new/pytest-xvfb-1.1.0/pytest_xvfb.py
--- old/pytest-xvfb-1.0.0/pytest_xvfb.py 2016-11-30 12:36:04.000000000
+0100
+++ new/pytest-xvfb-1.1.0/pytest_xvfb.py 2017-12-04 10:41:47.000000000
+0100
@@ -49,7 +49,13 @@
if not self._virtual_display.is_alive():
ret = self._virtual_display.return_code
- raise XvfbExitedError("Xvfb exited with exit code {0}".format(ret))
+ self._virtual_display.wait() # collect outputs
+ stdout = self._virtual_display.stdout
+ stderr = self._virtual_display.stderr
+ raise XvfbExitedError("Xvfb exited with exit code {0}\nXvfb
stdout:\n {1}\nXvfb stderr:\n {2}".format(
+ ret,
+ '\n '.join(stdout.splitlines()),
+ '\n '.join(stderr.splitlines())))
def stop(self):
self._virtual_display.stop()
@@ -68,7 +74,7 @@
parser.addini('xvfb_colordepth', 'Color depth of the Xvfb display',
default='16')
parser.addini('xvfb_args', 'Additional arguments for Xvfb',
- type='linelist')
+ type='args')
parser.addini('xvfb_xauth',
'Generate an Xauthority token for Xvfb. Needs xauth.',
default=False, type='bool')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/setup.cfg
new/pytest-xvfb-1.1.0/setup.cfg
--- old/pytest-xvfb-1.0.0/setup.cfg 2016-11-30 13:08:15.000000000 +0100
+++ new/pytest-xvfb-1.1.0/setup.cfg 2018-02-07 09:31:37.000000000 +0100
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/setup.py
new/pytest-xvfb-1.1.0/setup.py
--- old/pytest-xvfb-1.0.0/setup.py 2016-11-30 12:36:58.000000000 +0100
+++ new/pytest-xvfb-1.1.0/setup.py 2018-02-07 09:30:53.000000000 +0100
@@ -13,7 +13,7 @@
setup(
name='pytest-xvfb',
- version='1.0.0',
+ version='1.1.0',
author='Florian Bruhin',
author_email='[email protected]',
maintainer='Florian Bruhin',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/tests/conftest.py
new/pytest-xvfb-1.1.0/tests/conftest.py
--- old/pytest-xvfb-1.0.0/tests/conftest.py 1970-01-01 01:00:00.000000000
+0100
+++ new/pytest-xvfb-1.1.0/tests/conftest.py 2017-02-19 22:23:50.000000000
+0100
@@ -0,0 +1 @@
+pytest_plugins = 'pytester'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/tests/test_xvfb.py
new/pytest-xvfb-1.1.0/tests/test_xvfb.py
--- old/pytest-xvfb-1.0.0/tests/test_xvfb.py 1970-01-01 01:00:00.000000000
+0100
+++ new/pytest-xvfb-1.1.0/tests/test_xvfb.py 2017-12-04 10:41:47.000000000
+0100
@@ -0,0 +1,239 @@
+# -*- coding: utf-8 -*-
+
+import os
+
+import pytest
+
+import pytest_xvfb
+
+
+xauth_available = any(
+ os.access(os.path.join(path, 'xauth'), os.X_OK)
+ for path in os.environ.get('PATH', '').split(os.pathsep)
+)
+
+
[email protected](autouse=True, scope='session')
+def ensure_xvfb():
+ if not pytest_xvfb.xvfb_available():
+ raise Exception("Tests need Xvfb to run.")
+
+
+def test_xvfb_available(testdir, monkeypatch):
+ monkeypatch.delenv('DISPLAY')
+ testdir.makepyfile("""
+ import os
+
+ def test_display():
+ assert 'DISPLAY' in os.environ
+ """)
+ result = testdir.runpytest()
+ assert result.ret == 0
+
+
+def test_empty_display(testdir, monkeypatch):
+ monkeypatch.setenv('DISPLAY', '')
+ testdir.makepyfile("""
+ import os
+
+ def test_display():
+ assert 'DISPLAY' in os.environ
+ """)
+ result = testdir.runpytest()
+ assert os.environ['DISPLAY'] == ''
+ assert result.ret == 0
+
+
+def test_xvfb_unavailable(testdir, monkeypatch):
+ monkeypatch.setenv('PATH', '')
+ monkeypatch.setenv('DISPLAY', ':42')
+ testdir.makepyfile("""
+ import os
+
+ def test_display():
+ assert os.environ['DISPLAY'] == ':42'
+ """)
+ assert os.environ['DISPLAY'] == ':42'
+ result = testdir.runpytest()
+ result.stdout.fnmatch_lines('* could not find Xvfb.*')
+ assert result.ret == 0
+
+
+def test_no_xvfb_arg(testdir, monkeypatch):
+ monkeypatch.setenv('DISPLAY', ':42')
+ testdir.makepyfile("""
+ import os
+
+ def test_display():
+ assert os.environ['DISPLAY'] == ':42'
+ """)
+ assert os.environ['DISPLAY'] == ':42'
+ result = testdir.runpytest('--no-xvfb')
+ assert result.ret == 0
+
+
[email protected]('configured', [True, False])
+def test_screen_size(testdir, configured):
+ try:
+ import tkinter
+ except ImportError:
+ pytest.importorskip('Tkinter')
+
+ if configured:
+ testdir.makeini("""
+ [pytest]
+ xvfb_width = 1024
+ xvfb_height = 768
+ xvfb_colordepth = 8
+ """)
+ expected_width = 1024
+ expected_height = 768
+ expected_depth = 8
+ else:
+ expected_width = 800
+ expected_height = 600
+ expected_depth = 16
+
+ testdir.makepyfile("""
+ try:
+ import tkinter as tk
+ except ImportError:
+ import Tkinter as tk
+
+ def test_screen_size():
+ root = tk.Tk()
+ assert root.winfo_screenwidth() == {width}
+ assert root.winfo_screenheight() == {height}
+ assert root.winfo_screendepth() == {depth}
+ """.format(width=expected_width, height=expected_height,
+ depth=expected_depth))
+ result = testdir.runpytest()
+ assert result.ret == 0
+
+
+def test_failing_start(testdir, monkeypatch):
+ testdir.makeini("""
+ [pytest]
+ xvfb_args = -foo
+ """)
+ testdir.makepyfile("""
+ def test_none():
+ pass
+ """)
+ result = testdir.runpytest()
+ result.stderr.fnmatch_lines([
+ "INTERNALERROR> *XvfbExitedError: Xvfb exited with exit code 1",
+ "INTERNALERROR> Xvfb stdout:",
+ "INTERNALERROR> Xvfb stderr:",
+ "INTERNALERROR> Unrecognized option: -foo",
+ ])
+ assert 'OSError' not in str(result.stderr)
+
+
[email protected]('args, outcome', [
+ ([], '1 passed, 1 skipped'),
+ (['--no-xvfb'], '2 passed'),
+])
+def test_no_xvfb_marker(testdir, args, outcome):
+ testdir.makepyfile("""
+ import pytest
+
+ @pytest.mark.no_xvfb
+ def test_marked():
+ pass
+
+ def test_unmarked():
+ pass
+ """)
+ res = testdir.runpytest(*args)
+ res.stdout.fnmatch_lines('*= {0}*'.format(outcome))
+
+
+def test_xvfb_fixture(testdir):
+ testdir.makepyfile("""
+ import os
+
+ def test_display(xvfb):
+ assert ':{}'.format(xvfb.display) == os.environ['DISPLAY']
+
+ def test_screen(xvfb):
+ assert xvfb.width == 800
+ assert xvfb.height == 600
+ assert xvfb.colordepth == 16
+
+ def test_args(xvfb):
+ assert xvfb.args == []
+ """)
+ result = testdir.runpytest()
+ assert result.ret == 0
+
+
+def test_early_display(monkeypatch, testdir):
+ """Make sure DISPLAY is set in a session-scoped fixture already."""
+ monkeypatch.delenv('DISPLAY')
+ testdir.makepyfile("""
+ import os
+ import pytest
+
+ @pytest.yield_fixture(scope='session', autouse=True)
+ def fixt():
+ assert 'DISPLAY' in os.environ
+ yield
+
+ def test_foo():
+ pass
+ """)
+
+
+def test_strict_markers(testdir):
+ testdir.makepyfile("""
+ import pytest
+
+ @pytest.mark.no_xvfb
+ def test_marked():
+ pass
+ """)
+ result = testdir.runpytest('--strict')
+ assert result.ret == 0
+
+
+def test_xvfb_session_fixture(testdir):
+ """Make sure the xvfb fixture can be used from a session-wide one."""
+ testdir.makepyfile("""
+ import pytest
+
+ @pytest.fixture(scope='session')
+ def fixt(xvfb):
+ pass
+
+ def test_fixt(fixt):
+ pass
+ """)
+ result = testdir.runpytest()
+ assert result.ret == 0
+
+
[email protected](not xauth_available, reason='no xauth')
+def test_xvfb_with_xauth(testdir):
+ original_auth = os.environ.get('XAUTHORITY')
+ testdir.makeini("""
+ [pytest]
+ xvfb_xauth = True
+ """)
+ testdir.makepyfile("""
+ import os
+
+ def test_xauth():
+ print('\\nXAUTHORITY: ' + os.environ['XAUTHORITY'])
+ assert os.path.isfile(os.environ['XAUTHORITY'])
+ assert os.access(os.environ['XAUTHORITY'], os.R_OK)
+ """)
+ result = testdir.runpytest('-s')
+ # Get and parse the XAUTHORITY: line
+ authline = next(l for l in result.outlines if l.startswith('XAUTHORITY:'))
+ authfile = authline.split(' ', 1)[1]
+
+ assert result.ret == 0
+ # Make sure the authfile is deleted
+ assert not os.path.exists(authfile)
+ assert os.environ.get('XAUTHORITY') == original_auth
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/tests/test_xvfb_windows.py
new/pytest-xvfb-1.1.0/tests/test_xvfb_windows.py
--- old/pytest-xvfb-1.0.0/tests/test_xvfb_windows.py 1970-01-01
01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/tests/test_xvfb_windows.py 2017-02-19
22:23:50.000000000 +0100
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+"""Make sure things don't break on Windows with no Xvfb available."""
+
+
+def test_xvfb_windows(testdir):
+ testdir.makepyfile("""
+ def test_nothing():
+ pass
+ """)
+ result = testdir.runpytest()
+ assert result.ret == 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-xvfb-1.0.0/tox.ini
new/pytest-xvfb-1.1.0/tox.ini
--- old/pytest-xvfb-1.0.0/tox.ini 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-xvfb-1.1.0/tox.ini 2017-02-19 22:23:50.000000000 +0100
@@ -0,0 +1,9 @@
+# For more information about tox, see https://tox.readthedocs.org/en/latest/
+[tox]
+envlist = py27,py33,py34,py35,pypy
+
+[testenv]
+deps =
+ pytest
+ pyvirtualdisplay
+commands = py.test {posargs:tests}