1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 mock,
7 pytest,
8}:
9
10buildPythonPackage rec {
11 pname = "flaky";
12 version = "3.8.1";
13 pyproject = true;
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-RyBKgeyQXz1az71h2uq8raj51AMWFtm8sGGEYXKWmfU=";
18 };
19
20 build-system = [ setuptools ];
21
22 nativeCheckInputs = [
23 mock
24 pytest
25 ];
26
27 checkPhase = ''
28 # based on tox.ini
29 pytest -k 'example and not options' --doctest-modules test/test_pytest/
30 pytest -k 'example and not options' test/test_pytest/
31 pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py
32 pytest --force-flaky --max-runs 2 test/test_pytest/test_pytest_options_example.py
33 '';
34
35 meta = with lib; {
36 changelog = "https://github.com/box/flaky/blob/v${version}/HISTORY.rst";
37 homepage = "https://github.com/box/flaky";
38 description = "Plugin for nose or py.test that automatically reruns flaky tests";
39 license = licenses.asl20;
40 };
41}