pythonPackages.cyclonedx-python-lib: fix checkPhase

The unit tests for this package require the tests directory to be on the
PYTHONPATH. We also can switch to pytest to run most of the
TestOutputJson test cases, explicitly disabling the few that require
network access.
This commit is contained in:
Noah Fontes
2022-09-16 09:54:56 -07:00
parent b515e72bd7
commit 383f370416
@@ -6,6 +6,7 @@
, lxml
, packageurl-python
, poetry-core
, pytestCheckHook
, python
, pythonOlder
, requirements-parser
@@ -14,7 +15,6 @@
, toml
, types-setuptools
, types-toml
, unittestCheckHook
, xmldiff
}:
@@ -48,7 +48,7 @@ buildPythonPackage rec {
];
checkInputs = [
unittestCheckHook
pytestCheckHook
jsonschema
lxml
xmldiff
@@ -59,9 +59,17 @@ buildPythonPackage rec {
];
preCheck = ''
rm tests/test_output_json.py
export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
'';
pytestFlagsArray = [ "tests/" ];
disabledTests = [
# These tests require network access.
"test_bom_v1_3_with_metadata_component"
"test_bom_v1_4_with_metadata_component"
];
meta = with lib; {
description = "Python library for generating CycloneDX SBOMs";
homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";