commit:     f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Wed Jan  1 11:55:44 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Jan 23 09:53:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3b96f90

dev-python/pytest-qt: pytest plugin for Qt (PyQt4, PyQt5 and PySide)

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Closes: https://github.com/gentoo/gentoo/pull/14007
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-python/pytest-qt/Manifest                      |  1 +
 .../pytest-qt-3.3.0-skip-show-window-test.patch    | 36 +++++++++++++++++++++
 dev-python/pytest-qt/metadata.xml                  | 12 +++++++
 dev-python/pytest-qt/pytest-qt-3.3.0.ebuild        | 37 ++++++++++++++++++++++
 4 files changed, 86 insertions(+)

diff --git a/dev-python/pytest-qt/Manifest b/dev-python/pytest-qt/Manifest
new file mode 100644
index 00000000000..15c6c8683df
--- /dev/null
+++ b/dev-python/pytest-qt/Manifest
@@ -0,0 +1 @@
+DIST pytest-qt-3.3.0.tar.gz 113439 BLAKE2B 
1eb486d2d44825058577306ed3b9ade34e6cbad0d90038fe314114bb22c82ae069c9fe66c170591de6c97bad99f5f9e0021c8b3dc38c858b8293a22c448bed74
 SHA512 
8b3ce7b62621c55fb319966b162cb60663c5ef290f34e62e6a9329e67f530c2bde1329ae0b045b15c99ae14f5f6a5fef9ee930475fa700922c50ee725adf7983

diff --git 
a/dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch 
b/dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch
new file mode 100644
index 00000000000..1acef2bb492
--- /dev/null
+++ b/dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch
@@ -0,0 +1,36 @@
+diff --git a/tests/test_basics.py b/tests/test_basics.py
+index 7fdaf93..a972ea0 100644
+--- a/tests/test_basics.py
++++ b/tests/test_basics.py
+@@ -82,31 +82,6 @@ def test_stop_for_interaction(qtbot, timer):
+     qtbot.stopForInteraction()
+ 
+ 
+-@pytest.mark.parametrize("show", [True, False])
+-@pytest.mark.parametrize("method_name", ["waitExposed", "waitActive"])
+-def test_wait_window(show, method_name, qtbot):
+-    """
+-    Using one of the wait-widget methods should not raise anything if the 
widget
+-    is properly displayed, otherwise should raise a TimeoutError.
+-    """
+-    method = getattr(qtbot, method_name)
+-    if qt_api.pytest_qt_api != "pyqt5":
+-        with pytest.raises(RuntimeError) as exc_info:
+-            with method(None, None):
+-                pass
+-        assert str(exc_info.value) == "Available in PyQt5 only"
+-    else:
+-        widget = qt_api.QWidget()
+-        qtbot.add_widget(widget)
+-        if show:
+-            with method(widget, timeout=1000):
+-                widget.show()
+-        else:
+-            with pytest.raises(qtbot.TimeoutError):
+-                with method(widget, timeout=100):
+-                    pass
+-
+-
+ @pytest.mark.parametrize("method_name", ["waitExposed", "waitActive"])
+ def test_wait_window_propagates_other_exception(method_name, qtbot):
+     """

diff --git a/dev-python/pytest-qt/metadata.xml 
b/dev-python/pytest-qt/metadata.xml
new file mode 100644
index 00000000000..d22e99d7357
--- /dev/null
+++ b/dev-python/pytest-qt/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>andrewammerl...@riseup.net</email>
+               <name>Andrew Ammerlaan</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-ma...@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+</pkgmetadata>

diff --git a/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild 
b/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild
new file mode 100644
index 00000000000..4f2d4bd24ba
--- /dev/null
+++ b/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1 virtualx
+
+DESCRIPTION="pytest plugin for PyQt4 or PyQt5 applications"
+HOMEPAGE="https://pypi.org/project/pytest-qt 
https://github.com/pytest-dev/pytest-qt";
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="dev-python/QtPy[gui,testlib,${PYTHON_USEDEP}]"
+
+PATCHES=( "${FILESDIR}/${P}-skip-show-window-test.patch" )
+
+distutils_enable_tests pytest
+distutils_enable_sphinx docs dev-python/sphinx_rtd_theme
+
+python_test() {
+       pytest_qt_test() {
+               # pytest-qt test fail to test in ${BUILDIR}/lib
+               # if and only if pytest-qt is not already installed
+               # test do work if executed directly in the extracted tarball
+               local PYTHONPATH="${WORKDIR}/${P}"
+               pytest -vv
+       }
+
+       virtx pytest_qt_test
+}

Reply via email to