diff options
author | Andrew Ammerlaan <andrewammerlaan@riseup.net> | 2020-01-01 12:55:44 +0100 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2020-01-23 11:53:19 +0200 |
commit | f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70 (patch) | |
tree | 847fc60e00b5e73d8a86e094a0106b4cc731209f /dev-python | |
parent | dev-python/qtawesome: Version bump 0.6.1 (diff) | |
download | gentoo-f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70.tar.gz gentoo-f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70.tar.bz2 gentoo-f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70.zip |
dev-python/pytest-qt: pytest plugin for Qt (PyQt4, PyQt5 and PySide)
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@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@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/pytest-qt/Manifest | 1 | ||||
-rw-r--r-- | dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch | 36 | ||||
-rw-r--r-- | dev-python/pytest-qt/metadata.xml | 12 | ||||
-rw-r--r-- | dev-python/pytest-qt/pytest-qt-3.3.0.ebuild | 37 |
4 files changed, 86 insertions, 0 deletions
diff --git a/dev-python/pytest-qt/Manifest b/dev-python/pytest-qt/Manifest new file mode 100644 index 000000000000..15c6c8683df4 --- /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 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 +} |