summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pytest-testinfra/default.nix
blob: de2bfe9befc7fa4df7658515e906c2830dbd2044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  ansible-core,
  buildPythonPackage,
  fetchPypi,
  hatchling,
  hatch-vcs,
  paramiko,
  pytest-xdist,
  pytestCheckHook,
  pywinrm,
  salt,
}:

buildPythonPackage rec {
  pname = "pytest-testinfra";
  version = "10.2.2";
  pyproject = true;

  src = fetchPypi {
    pname = "pytest_testinfra";
    inherit version;
    hash = "sha256-U3/V64jaYYwfRhJIqiBZTPjURRLoUZsjmDfoOHXh6c0=";
  };

  build-system = [
    hatchling
    hatch-vcs
  ];

  nativeCheckInputs = [
    ansible-core
    paramiko
    pytestCheckHook
    pytest-xdist
    pywinrm
    salt
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
    # docker is required for all disabled tests
    # test/test_backends.py
    "test_command"
    "test_encoding"
    "test_ansible_any_error_fatal"
    "test_user_connection"
    "test_sudo"
    "test_docker_encoding"
    # Broken because salt package only built for Python
    "test_backend_importables"
  ];

  disabledTestPaths = [ "test/test_modules.py" ];

  meta = {
    description = "Pytest plugin for testing your infrastructure";
    homepage = "https://github.com/pytest-dev/pytest-testinfra";
    changelog = "https://github.com/pytest-dev/pytest-testinfra/releases/tag/${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ hulr ];
  };
}