nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, httpbin
5, pytest
6, pytestCheckHook
7, requests
8, six
9}:
10
11buildPythonPackage rec {
12 pname = "pytest-httpbin";
13 version = "1.0.1";
14
15 src = fetchFromGitHub {
16 owner = "kevin1024";
17 repo = "pytest-httpbin";
18 rev = "v${version}";
19 hash = "sha256-Vngd8Vum96+rdG8Nz1+aHrO6WZjiAz+0CeIovaH8N+s=";
20 };
21
22 buildInputs = [
23 pytest
24 ];
25
26 propagatedBuildInputs = [
27 httpbin
28 six
29 ];
30
31 preCheck = ''
32 # Remove assertion that doesn't hold for Flask 2.1.0
33 substituteInPlace tests/test_server.py \
34 --replace "assert response.headers['Location'].startswith('https://')" ""
35 '';
36
37 checkInputs = [
38 pytestCheckHook
39 requests
40 ];
41
42 pythonImportsCheck = [
43 "pytest_httpbin"
44 ];
45
46 meta = with lib; {
47 description = "Test your HTTP library against a local copy of httpbin.org";
48 homepage = "https://github.com/kevin1024/pytest-httpbin";
49 license = licenses.mit;
50 maintainers = with maintainers; [ ];
51 };
52}