nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, pytest
6, pytest-asyncio
7, pytestCheckHook
8, setuptools-scm
9}:
10
11buildPythonPackage rec {
12 pname = "pytest-mock";
13 version = "3.7.0";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-URK9ksyfGG7pbhqS78hJaepJSTnDrq05xQ9CHEzGlTQ=";
18 };
19
20 patches = [
21 (fetchpatch {
22 # pytest7 compatbilitya
23 url = "https://github.com/pytest-dev/pytest-mock/commit/0577f1ad051fb8d0da94ea22dcb02346d74064b2.patch";
24 hash = "sha256-eim4v7U8Mjigr462bXI0pKH/M0ANBzSRc0lT4RpbZ0w=";
25 })
26 ];
27
28 nativeBuildInputs = [ setuptools-scm ];
29
30 propagatedBuildInputs = [
31 pytest
32 ];
33
34 checkInputs = [
35 pytest-asyncio
36 pytestCheckHook
37 ];
38
39 disabledTests = [
40 # output of pytest has changed
41 "test_used_with_"
42 "test_plain_stopall"
43 ];
44
45 pythonImportsCheck = [ "pytest_mock" ];
46
47 meta = with lib; {
48 description = "Thin-wrapper around the mock package for easier use with pytest";
49 homepage = "https://github.com/pytest-dev/pytest-mock";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ dotlambda ];
52 };
53}