commit:     3b9a4b6ca84a7479a0ed441b761fd425311141f5
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sat Apr 25 00:08:22 2020 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sat Apr 25 00:37:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3b9a4b6c

dev-python/pytest-randomly: new package

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-python/pytest-randomly/Manifest                |  1 +
 dev-python/pytest-randomly/metadata.xml            | 34 ++++++++++++++++
 .../pytest-randomly/pytest-randomly-3.3.1.ebuild   | 46 ++++++++++++++++++++++
 3 files changed, 81 insertions(+)

diff --git a/dev-python/pytest-randomly/Manifest 
b/dev-python/pytest-randomly/Manifest
new file mode 100644
index 0000000..8c9c377
--- /dev/null
+++ b/dev-python/pytest-randomly/Manifest
@@ -0,0 +1 @@
+DIST pytest-randomly-3.3.1.tar.gz 31404 BLAKE2B 
28a77b2c7043ece3305e1971957b23a7188bf1889483c9747f2fe925bfe72e872d8e8f4a52e3dc372f9934dd81c3e88bbc9be52bc574605faed80e57fa852d3c
 SHA512 
242274b1e9fcbb03278766ddd46e8d3dca2374f09db0d111feb0bebdabab4d46ecc63d17f17e692cf4adf662dd3b450f87fe14e248488acb4d3c629567d54458

diff --git a/dev-python/pytest-randomly/metadata.xml 
b/dev-python/pytest-randomly/metadata.xml
new file mode 100644
index 0000000..46c4254
--- /dev/null
+++ b/dev-python/pytest-randomly/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Alessandro Barbieri</name>
+  </maintainer>
+  <longdescription lang="en">
+Features
+
+All of these features are on by default but can be disabled with flags.
+
+    Randomly shuffles the order of test items. This is done first at the level 
of modules, then at the level of test classes (if you have them), then at the 
order of functions. This also works with things like doctests.
+    Resets random.seed() at the start of every test case and test to a fixed 
number - this defaults to time.time() from the start of your test run, but you 
can pass in --randomly-seed to repeat a randomness-induced failure.
+    If factory boy is installed, its random state is reset at the start of 
every test. This allows for repeatable use of its random ‘fuzzy’ features.
+    If faker is installed, its random state is reset at the start of every 
test. This is also for repeatable fuzzy data in tests - factory boy uses faker 
for lots of data.
+    If numpy is installed, its random state is reset at the start of every 
test.
+    If additional random generators are used, they can be registered under the 
pytest_randomly.random_seeder entry point and will have their seed reset at the 
start of every test. Register a function that takes the current seed value.
+    Works with pytest-xdist.
+
+About
+
+Randomness in testing can be quite powerful to discover hidden flaws in the 
tests themselves, as well as giving a little more coverage to your system.
+
+By randomly ordering the tests, the risk of surprising inter-test dependencies 
is reduced - a technique used in many places, for example Google’s C++ test 
runner googletest.
+
+By resetting the random seed to a repeatable number for each test, tests can 
create data based on random numbers and yet remain repeatable, for example 
factory boy’s fuzzy values. This is good for ensuring that tests specify the 
data they need and that the tested system is not affected by any data that is 
filled in randomly due to not being specified.
+
+This plugin is a Pytest port of my plugin for nose, nose-randomly. I’ve 
written a blog post on its history.
+  </longdescription>
+  <upstream>
+    <remote-id type="github">pytest-dev/pytest-randomly</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/dev-python/pytest-randomly/pytest-randomly-3.3.1.ebuild 
b/dev-python/pytest-randomly/pytest-randomly-3.3.1.ebuild
new file mode 100644
index 0000000..2796f69
--- /dev/null
+++ b/dev-python/pytest-randomly/pytest-randomly-3.3.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+DESCRIPTION="Pytest plugin to randomly order tests and control random.seed"
+HOMEPAGE="
+       https://pypi.python.org/pypi/pytest-randomly
+       https://github.com/pytest-dev/pytest-randomly
+"
+SRC_URI="https://github.com/pytest-dev/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="test"
+
+RDEPEND="
+       dev-python/docutils[${PYTHON_USEDEP}]
+       dev-python/factory_boy[${PYTHON_USEDEP}]
+       dev-python/faker[${PYTHON_USEDEP}]
+       dev-python/isort[${PYTHON_USEDEP}]
+       dev-python/numpy[${PYTHON_USEDEP}]
+       dev-python/pygments[${PYTHON_USEDEP}]
+       dev-python/secretstorage[${PYTHON_USEDEP}]
+       dev-python/twine[${PYTHON_USEDEP}]
+
+       $(python_gen_cond_dep 'dev-python/black[${PYTHON_USEDEP}]' python3_8)
+       $(python_gen_cond_dep 'dev-python/importlib_metadata[${PYTHON_USEDEP}]' 
python3_6 python3_7)
+"
+#DEPEND="
+#      test? (
+#              $(python_gen_cond_dep 
'dev-python/check-manifest[${PYTHON_USEDEP}]' python3_8)
+#              dev-python/multilint[${PYTHON_USEDEP}]
+#              dev-python/pytest-xdist[${PYTHON_USEDEP}]
+#      )
+#"
+
+#no multilint for now
+#distutils_enable_tests pytest

Reply via email to