Skip to content

Commit

Permalink
[issue-558] add test for optional feature to GitHub Action
Browse files Browse the repository at this point in the history
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
  • Loading branch information
meretp committed Apr 6, 2023
1 parent 91bb744 commit 05c0dfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ jobs:
run: pytest
- name: Run CLI
run: pyspdxtools -i ./tests/spdx/data/formats/SPDXJSONExample-v2.3.spdx.json

- name: Install optional dependencies
run: python -m pip install networkx
- name: Run tests for graph generation
run: pytest tests/spdx/test_graph_generation.py
3 changes: 1 addition & 2 deletions tests/spdx/test_graph_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

try:
import networkx # noqa: F401
import pygraphviz # noqa: F401
except ImportError:
pytest.skip("Skip this module as the tests need optional dependencies to run.", allow_module_level=True)

Expand Down Expand Up @@ -44,7 +43,7 @@
(
"SPDXRdfExample-v2.2.spdx.rdf.xml",
20,
17,
19,
["SPDXRef-Package_DYNAMIC_LINK", "SPDXRef-JenaLib_CONTAINS"],
),
(
Expand Down

0 comments on commit 05c0dfb

Please sign in to comment.