nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 fetchpatch2,
6 mock,
7 pytestCheckHook,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "parameterized";
13 version = "0.9.0";
14 pyproject = true;
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-f8kFJyzvpPNkwaNCnLvpwPmLeTmI77W/kKrIDwjbCbE=";
19 };
20
21 patches = [
22 (fetchpatch2 {
23 name = "parameterized-docstring-3.13-compat.patch";
24 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-python/parameterized/files/parameterized-0.9.0-py313-test.patch?id=dec60bb6900d6ebdaaa6aa1dcb845b30b739f9b5";
25 hash = "sha256-tWcN0eRC0oRHrOaa/cctXLhi1WapDKvxO36e6gU6UIk=";
26 })
27 ];
28
29 postPatch = ''
30 # broken with pytest 7 and python 3.12
31 # https://github.com/wolever/parameterized/issues/167
32 # https://github.com/wolever/parameterized/pull/162
33 substituteInPlace parameterized/test.py \
34 --replace 'assert_equal(missing, [])' "" \
35 --replace "assertRaisesRegexp" "assertRaisesRegex"
36 '';
37
38 nativeBuildInputs = [ setuptools ];
39
40 # 'yield' keyword is allowed in fixtures, but not in tests (test_naked_function)
41 doCheck = false;
42
43 checkInputs = [
44 mock
45 pytestCheckHook
46 ];
47
48 enabledTestPaths = [ "parameterized/test.py" ];
49
50 pythonImportsCheck = [ "parameterized" ];
51
52 meta = {
53 description = "Parameterized testing with any Python test framework";
54 homepage = "https://github.com/wolever/parameterized";
55 changelog = "https://github.com/wolever/parameterized/blob/v${version}/CHANGELOG.txt";
56 license = lib.licenses.bsd2;
57 maintainers = [ ];
58 };
59}