about summary refs log tree commit diff
path: root/pkgs/development/python-modules/unittest-xml-reporting/default.nix
blob: 36768b0fccb777d4e355e615a8de4de173538e94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ lib
, fetchFromGitHub
, buildPythonPackage
, lxml
, pythonAtLeast
, pythonOlder
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "unittest-xml-reporting";
  version = "3.2.0";
  format = "setuptools";
  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "xmlrunner";
    repo = "unittest-xml-reporting";
    rev = version;
    hash = "sha256-lOJ/+8CVJUXdIaZLLF5PpPkG0DzlNgo46kRZ1Xy7Ju0=";
  };

  propagatedBuildInputs = [
    lxml
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = lib.optionals (pythonAtLeast "3.11") [
    # AttributeError: 'tuple' object has no attribute 'shortDescription'
    "--deselect=tests/testsuite.py::XMLTestRunnerTestCase::test_basic_unittest_constructs"
    "--deselect=tests/testsuite.py::XMLTestRunnerTestCase::test_unexpected_success"
  ];

  pythonImportsCheck = [ "xmlrunner" ];

  meta = with lib; {
    homepage = "https://github.com/xmlrunner/unittest-xml-reporting";
    description = "unittest-based test runner with Ant/JUnit like XML reporting";
    license = licenses.bsd2;
    maintainers = with maintainers; [ rprospero ];
  };
}