summaryrefslogtreecommitdiff
path: root/dev-python/pytest-qt
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pytest-qt')
-rw-r--r--dev-python/pytest-qt/Manifest4
-rw-r--r--dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch36
-rw-r--r--dev-python/pytest-qt/metadata.xml12
-rw-r--r--dev-python/pytest-qt/pytest-qt-3.3.0.ebuild37
4 files changed, 89 insertions, 0 deletions
diff --git a/dev-python/pytest-qt/Manifest b/dev-python/pytest-qt/Manifest
new file mode 100644
index 000000000000..6b2891a90181
--- /dev/null
+++ b/dev-python/pytest-qt/Manifest
@@ -0,0 +1,4 @@
+AUX pytest-qt-3.3.0-skip-show-window-test.patch 1318 BLAKE2B 7e1c628c13f02d6219d752e3bbd6c54d17b54d45fe84b608093a42796ed6208f12c62a6bfc7a685cf3f445f5c4f6ca9e496d9b55b088cfddc28313e02c07d45d SHA512 27f788b560e66e0de3b9f17144cdc2a31fb9a4a270efdb490dfe106109051669d55e10072c841ce8f0aa313bcfec397ff59c6c76842a6a4b58194a03c3ff07d3
+DIST pytest-qt-3.3.0.tar.gz 113439 BLAKE2B 1eb486d2d44825058577306ed3b9ade34e6cbad0d90038fe314114bb22c82ae069c9fe66c170591de6c97bad99f5f9e0021c8b3dc38c858b8293a22c448bed74 SHA512 8b3ce7b62621c55fb319966b162cb60663c5ef290f34e62e6a9329e67f530c2bde1329ae0b045b15c99ae14f5f6a5fef9ee930475fa700922c50ee725adf7983
+EBUILD pytest-qt-3.3.0.ebuild 942 BLAKE2B 5f8afb977eadbf613ce19e45ad504a2bf1361b1cdeb5d6fa88f18598d101a409919d251632cfb8ebe2547cf6455179711db17e38d98bcdf58b28066e486eb613 SHA512 128b7c9bc7fcc4c6cace8e3868593ec5e53826daa1d41775aa72d3b997832cc5b0133d5770435897274a6d528ca93dbd3a799e2054f0b18d96f30f5cf086aec6
+MISC metadata.xml 375 BLAKE2B 393138e315b4eae4dacb9339fbb5766e9dbaa84b7482babaddc08d524fb8b9939f6622ee9c6d09b66c61ac270fcc483fac39996a12ba87ccccf7cafd4c6d36db SHA512 9a44b6b9de4d1a61d6af9256519473541d5513cef349c15178c025dee3aaaa3f6772b1be56576411a985fcd9c70029c00743d8f577be8eaec4c5a44646c9cbf6
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 000000000000..1acef2bb4922
--- /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 000000000000..d22e99d73577
--- /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>andrewammerlaan@riseup.net</email>
+ <name>Andrew Ammerlaan</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@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 000000000000..4f2d4bd24bac
--- /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
+}