public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alessandro Barbieri" <lssndrbarbieri@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/pytest-randomly/
Date: Sat, 25 Apr 2020 00:37:25 +0000 (UTC)	[thread overview]
Message-ID: <1587775037.3b9a4b6ca84a7479a0ed441b761fd425311141f5.Alessandro-Barbieri@gentoo> (raw)

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>lssndrbarbieri@gmail.com</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	other threads:[~2020-04-25  0:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25  0:37 Alessandro Barbieri [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-25 12:53 [gentoo-commits] repo/proj/guru:dev commit in: dev-python/pytest-randomly/ Alessandro Barbieri
2020-04-27 21:24 Alessandro Barbieri
2020-05-18 18:39 Alessandro Barbieri
2020-05-19 11:24 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-05-19 11:13 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2020-05-19 19:46 Alessandro Barbieri
2020-08-28 15:26 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-08-28 15:26 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2020-12-09 23:00 Alessandro Barbieri
2020-12-18 19:05 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-12-18 19:05 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2021-04-14  9:05 Theo Anderson
2021-06-14  2:27 Alessandro Barbieri
2021-06-14 23:09 Alessandro Barbieri
2021-06-15 12:22 Alessandro Barbieri
2021-11-02  3:40 Alessandro Barbieri
2022-03-14  2:41 Alessandro Barbieri
2022-05-30 17:21 Alessandro Barbieri
2022-06-01  5:03 Anna Vyalkova
2023-03-16 13:59 Anna Vyalkova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587775037.3b9a4b6ca84a7479a0ed441b761fd425311141f5.Alessandro-Barbieri@gentoo \
    --to=lssndrbarbieri@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox