1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, mock
5, nose
6, pytest
7}:
8
9buildPythonPackage rec {
10 pname = "flaky";
11 version = "3.6.1";
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "8cd5455bb00c677f787da424eaf8c4a58a922d0e97126d3085db5b279a98b698";
16 };
17
18 checkInputs = [ mock nose pytest ];
19
20 checkPhase = ''
21 # based on tox.ini
22 pytest -k 'example and not options' --doctest-modules test/test_pytest/
23 pytest -k 'example and not options' test/test_pytest/
24 pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py
25 nosetests --with-flaky --force-flaky --max-runs 2 test/test_nose/test_nose_options_example.py
26 pytest --force-flaky --max-runs 2 test/test_pytest/test_pytest_options_example.py
27 '';
28
29 meta = with stdenv.lib; {
30 homepage = https://github.com/box/flaky;
31 description = "Plugin for nose or py.test that automatically reruns flaky tests";
32 license = licenses.asl20;
33 };
34
35}