1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5# install dependencies
6, pytest
7, vcrpy
8# test dependencies
9, hatchling
10, pytestCheckHook
11, pytest-httpbin
12, pytest-mock
13, requests
14}:
15
16buildPythonPackage rec {
17 pname = "pytest-recording";
18 version = "0.13.0";
19 format = "pyproject";
20
21 src = fetchFromGitHub {
22 owner = "kiwicom";
23 repo = "pytest-recording";
24 rev = "v${version}";
25 hash = "sha256-SCHdzii6GYVWVY7MW/IW6CNZMuu5h/jXEj49P0jvhoE=";
26 };
27
28 buildInputs = [
29 hatchling
30 pytest
31 ];
32
33 propagatedBuildInputs = [
34 vcrpy
35 ];
36
37 __darwinAllowLocalNetworking = true;
38
39 checkInputs = [
40 pytestCheckHook
41 pytest-httpbin
42 pytest-mock
43 requests
44 ];
45
46 disabledTests = [
47 "test_block_network_with_allowed_hosts"
48 ] ++ lib.optionals stdenv.isDarwin [
49 # Missing socket.AF_NETLINK
50 "test_other_socket"
51 ];
52
53 pytestFlagsArray = [
54 "tests"
55 ];
56
57 pythonImportsCheck = [
58 "pytest_recording"
59 ];
60
61 meta = with lib; {
62 description = "A pytest plugin that allows you recording of network interactions via VCR.py";
63 homepage = "https://github.com/kiwicom/pytest-recording";
64 license = licenses.mit;
65 maintainers = with maintainers; [ jbgosselin ];
66 };
67}