1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytest,
6 cram,
7 bash,
8}:
9
10buildPythonPackage rec {
11 version = "0.2.2";
12 format = "setuptools";
13 pname = "pytest-cram";
14
15 nativeCheckInputs = [ pytest ];
16 propagatedBuildInputs = [ cram ];
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "0405ymmrsv6ii2qhq35nxfjkb402sdb6d13xnk53jql3ybgmiqq0";
21 extension = "tar.gz";
22 };
23
24 postPatch = ''
25 substituteInPlace pytest_cram/tests/test_options.py \
26 --replace "/bin/bash" "${bash}/bin/bash"
27 '';
28
29 # Remove __init__.py from tests folder, otherwise pytest raises an error that
30 # the imported and collected modules are different.
31 checkPhase = ''
32 rm pytest_cram/tests/__init__.py
33 pytest pytest_cram/ --ignore=pytest_cram/tests/test_examples.py
34 '';
35
36 meta = {
37 description = "Test command-line applications with pytest and cram";
38 homepage = "https://github.com/tbekolay/pytest-cram";
39 license = lib.licenses.mit;
40 maintainers = with lib.maintainers; [ jluttine ];
41 };
42}