diff --git a/pkgs/development/python-modules/pytest-randomly/default.nix b/pkgs/development/python-modules/pytest-randomly/default.nix new file mode 100644 index 000000000000..c4523ac728c6 --- /dev/null +++ b/pkgs/development/python-modules/pytest-randomly/default.nix @@ -0,0 +1,31 @@ +{ lib, buildPythonPackage, fetchPypi, isPy27 +, factory_boy, faker, numpy +, pytest, pytest_xdist +}: + +buildPythonPackage rec { + pname = "pytest-randomly"; + version = "3.4.1"; + + disabled = isPy27; + + src = fetchPypi { + inherit pname version; + sha256 = "0s9cx692cdchfrjqx7fgf9wnm3fdac211a4hjq1cx9qqnbpdpl2z"; + }; + + propagatedBuildInputs = [ numpy factory_boy faker ]; + + checkInputs = [ pytest pytest_xdist ]; + + # test warnings are fixed on an unreleased version: + # https://github.com/pytest-dev/pytest-randomly/pull/281 + checkPhase = "pytest -p no:randomly"; + + meta = with lib; { + description = "Pytest plugin to randomly order tests and control random.seed"; + homepage = "https://github.com/pytest-dev/pytest-randomly"; + license = licenses.bsd3; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b23bdd75db15..2ac4f92122a9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2750,6 +2750,8 @@ in { pytest-raisesregexp = callPackage ../development/python-modules/pytest-raisesregexp { }; + pytest-randomly = callPackage ../development/python-modules/pytest-randomly { }; + pytest-random-order = callPackage ../development/python-modules/pytest-random-order { }; pytest-repeat = callPackage ../development/python-modules/pytest-repeat { };