Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-qt/, dev-python/pytest-qt/files/
Date: Thu, 23 Jan 2020 09:53:45
Message-Id: 1579773199.f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70.juippis@gentoo
1 commit: f3b96f90554a4b5fb85ad9e6cccf577dbbad6b70
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Wed Jan 1 11:55:44 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 23 09:53:19 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3b96f90
7
8 dev-python/pytest-qt: pytest plugin for Qt (PyQt4, PyQt5 and PySide)
9
10 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
11 Package-Manager: Portage-2.3.84, Repoman-2.3.20
12 Closes: https://github.com/gentoo/gentoo/pull/14007
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 dev-python/pytest-qt/Manifest | 1 +
16 .../pytest-qt-3.3.0-skip-show-window-test.patch | 36 +++++++++++++++++++++
17 dev-python/pytest-qt/metadata.xml | 12 +++++++
18 dev-python/pytest-qt/pytest-qt-3.3.0.ebuild | 37 ++++++++++++++++++++++
19 4 files changed, 86 insertions(+)
20
21 diff --git a/dev-python/pytest-qt/Manifest b/dev-python/pytest-qt/Manifest
22 new file mode 100644
23 index 00000000000..15c6c8683df
24 --- /dev/null
25 +++ b/dev-python/pytest-qt/Manifest
26 @@ -0,0 +1 @@
27 +DIST pytest-qt-3.3.0.tar.gz 113439 BLAKE2B 1eb486d2d44825058577306ed3b9ade34e6cbad0d90038fe314114bb22c82ae069c9fe66c170591de6c97bad99f5f9e0021c8b3dc38c858b8293a22c448bed74 SHA512 8b3ce7b62621c55fb319966b162cb60663c5ef290f34e62e6a9329e67f530c2bde1329ae0b045b15c99ae14f5f6a5fef9ee930475fa700922c50ee725adf7983
28
29 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
30 new file mode 100644
31 index 00000000000..1acef2bb492
32 --- /dev/null
33 +++ b/dev-python/pytest-qt/files/pytest-qt-3.3.0-skip-show-window-test.patch
34 @@ -0,0 +1,36 @@
35 +diff --git a/tests/test_basics.py b/tests/test_basics.py
36 +index 7fdaf93..a972ea0 100644
37 +--- a/tests/test_basics.py
38 ++++ b/tests/test_basics.py
39 +@@ -82,31 +82,6 @@ def test_stop_for_interaction(qtbot, timer):
40 + qtbot.stopForInteraction()
41 +
42 +
43 +-@×××××××××××.parametrize("show", [True, False])
44 +-@×××××××××××.parametrize("method_name", ["waitExposed", "waitActive"])
45 +-def test_wait_window(show, method_name, qtbot):
46 +- """
47 +- Using one of the wait-widget methods should not raise anything if the widget
48 +- is properly displayed, otherwise should raise a TimeoutError.
49 +- """
50 +- method = getattr(qtbot, method_name)
51 +- if qt_api.pytest_qt_api != "pyqt5":
52 +- with pytest.raises(RuntimeError) as exc_info:
53 +- with method(None, None):
54 +- pass
55 +- assert str(exc_info.value) == "Available in PyQt5 only"
56 +- else:
57 +- widget = qt_api.QWidget()
58 +- qtbot.add_widget(widget)
59 +- if show:
60 +- with method(widget, timeout=1000):
61 +- widget.show()
62 +- else:
63 +- with pytest.raises(qtbot.TimeoutError):
64 +- with method(widget, timeout=100):
65 +- pass
66 +-
67 +-
68 + @pytest.mark.parametrize("method_name", ["waitExposed", "waitActive"])
69 + def test_wait_window_propagates_other_exception(method_name, qtbot):
70 + """
71
72 diff --git a/dev-python/pytest-qt/metadata.xml b/dev-python/pytest-qt/metadata.xml
73 new file mode 100644
74 index 00000000000..d22e99d7357
75 --- /dev/null
76 +++ b/dev-python/pytest-qt/metadata.xml
77 @@ -0,0 +1,12 @@
78 +<?xml version="1.0" encoding="UTF-8"?>
79 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
80 +<pkgmetadata>
81 + <maintainer type="person">
82 + <email>andrewammerlaan@××××××.net</email>
83 + <name>Andrew Ammerlaan</name>
84 + </maintainer>
85 + <maintainer type="project">
86 + <email>proxy-maint@g.o</email>
87 + <name>Proxy Maintainers</name>
88 + </maintainer>
89 +</pkgmetadata>
90
91 diff --git a/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild b/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild
92 new file mode 100644
93 index 00000000000..4f2d4bd24ba
94 --- /dev/null
95 +++ b/dev-python/pytest-qt/pytest-qt-3.3.0.ebuild
96 @@ -0,0 +1,37 @@
97 +# Copyright 1999-2020 Gentoo Authors
98 +# Distributed under the terms of the GNU General Public License v2
99 +
100 +EAPI=7
101 +
102 +PYTHON_COMPAT=( python3_{6,7} )
103 +
104 +DISTUTILS_USE_SETUPTOOLS=rdepend
105 +
106 +inherit distutils-r1 virtualx
107 +
108 +DESCRIPTION="pytest plugin for PyQt4 or PyQt5 applications"
109 +HOMEPAGE="https://pypi.org/project/pytest-qt https://github.com/pytest-dev/pytest-qt"
110 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
111 +
112 +LICENSE="MIT"
113 +SLOT="0"
114 +KEYWORDS="~amd64 ~x86"
115 +
116 +DEPEND="dev-python/QtPy[gui,testlib,${PYTHON_USEDEP}]"
117 +
118 +PATCHES=( "${FILESDIR}/${P}-skip-show-window-test.patch" )
119 +
120 +distutils_enable_tests pytest
121 +distutils_enable_sphinx docs dev-python/sphinx_rtd_theme
122 +
123 +python_test() {
124 + pytest_qt_test() {
125 + # pytest-qt test fail to test in ${BUILDIR}/lib
126 + # if and only if pytest-qt is not already installed
127 + # test do work if executed directly in the extracted tarball
128 + local PYTHONPATH="${WORKDIR}/${P}"
129 + pytest -vv
130 + }
131 +
132 + virtx pytest_qt_test
133 +}