1{
2 lib,
3 ansible-core,
4 buildPythonPackage,
5 fetchPypi,
6 paramiko,
7 pytest-xdist,
8 pytestCheckHook,
9 pythonOlder,
10 pywinrm,
11 salt,
12 setuptools-scm,
13}:
14
15buildPythonPackage rec {
16 pname = "pytest-testinfra";
17 version = "10.1.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-93Qzm5R3Ws3zqMSjeTqOrS6N/HD/NLd4vhWquhQPoZ4=";
25 };
26
27 build-system = [ setuptools-scm ];
28
29 nativeCheckInputs = [
30 ansible-core
31 paramiko
32 pytestCheckHook
33 pytest-xdist
34 pywinrm
35 salt
36 ];
37
38 # Markers don't get added when docker is not available (leads to warnings):
39 # https://github.com/pytest-dev/pytest-testinfra/blob/9.0.0/test/conftest.py#L223
40 preCheck = ''
41 export HOME=$(mktemp -d)
42 sed -i '54imarkers = \
43 \ttestinfra_hosts(host_selector): mark test to run on selected hosts \
44 \tdestructive: mark test as destructive \
45 \tskip_wsl: skip test on WSL, no systemd support' setup.cfg
46 '';
47
48 disabledTests = [
49 # docker is required for all disabled tests
50 # test/test_backends.py
51 "test_command"
52 "test_encoding"
53 "test_ansible_any_error_fatal"
54 "test_user_connection"
55 "test_sudo"
56 "test_docker_encoding"
57 # Broken because salt package only built for Python
58 "test_backend_importables"
59 ];
60
61 disabledTestPaths = [ "test/test_modules.py" ];
62
63 meta = with lib; {
64 description = "Pytest plugin for testing your infrastructure";
65 homepage = "https://github.com/pytest-dev/pytest-testinfra";
66 changelog = "https://github.com/pytest-dev/pytest-testinfra/releases/tag/${version}";
67 license = licenses.asl20;
68 maintainers = with maintainers; [ hulr ];
69 };
70}