1{ lib 2, buildPythonPackage 3, fetchPypi 4, fetchpatch 5, pythonAtLeast 6, pbr 7, testtools 8, mock 9, python 10}: 11 12buildPythonPackage rec { 13 pname = "fixtures"; 14 version = "3.0.0"; 15 16 src = fetchPypi { 17 inherit pname version; 18 sha256 = "fcf0d60234f1544da717a9738325812de1f42c2fa085e2d9252d8fff5712b2ef"; 19 }; 20 21 patches = lib.optional (pythonAtLeast "3.9") [ 22 # drop tests that try to monkeypatch a classmethod, which fails on python3.9 23 # https://github.com/testing-cabal/fixtures/issues/44 24 (fetchpatch { 25 url = "https://salsa.debian.org/openstack-team/python/python-fixtures/-/raw/debian/victoria/debian/patches/remove-broken-monkey-patch-test.patch"; 26 sha256 = "1s3hg2zmqc4shmnf90kscphzj5qlqpxghzw2a59p8f88zrbsj97r"; 27 }) 28 ]; 29 30 nativeBuildInputs = [ 31 pbr 32 ]; 33 34 propagatedBuildInputs = [ 35 testtools 36 ]; 37 38 checkInputs = [ 39 mock 40 ]; 41 42 checkPhase = '' 43 ${python.interpreter} -m testtools.run fixtures.test_suite 44 ''; 45 46 meta = { 47 description = "Reusable state for writing clean tests and more"; 48 homepage = "https://pypi.python.org/pypi/fixtures"; 49 license = lib.licenses.asl20; 50 }; 51}