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