1{ buildPythonPackage
2# pkgs dependencies
3, check
4, cppunit
5, pkg-config
6, subunit
7, pythonOlder
8
9# python dependencies
10, fixtures
11, hypothesis
12, pytest
13, testscenarios
14, testtools
15, unittest2
16}:
17
18buildPythonPackage {
19 inherit (subunit) name src meta;
20
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [ check cppunit ];
23 propagatedBuildInputs = [ testtools ];
24
25 checkInputs = [ testscenarios hypothesis fixtures pytest unittest2 ];
26
27 # requires unittest2, which no longer supported in 3.10
28 doCheck = pythonOlder "3.10";
29 # ignore tests which call shell code, or call methods which haven't been implemented
30 checkPhase = ''
31 pytest python/subunit \
32 --ignore=python/subunit/tests/test_{output_filter,test_protocol{,2}}.py
33 '';
34
35 postPatch = ''
36 sed -i 's/version=VERSION/version="${subunit.version}"/' setup.py
37 '';
38}