1{ lib, buildPythonPackage, fetchPypi, pytest, cram, bash }:
2
3buildPythonPackage rec {
4 version = "0.2.2";
5 pname = "pytest-cram";
6
7 nativeCheckInputs = [ pytest ];
8 propagatedBuildInputs = [ cram ];
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "0405ymmrsv6ii2qhq35nxfjkb402sdb6d13xnk53jql3ybgmiqq0";
13 extension = "tar.gz";
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/ --ignore=pytest_cram/tests/test_examples.py
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}