diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97c4171e758525dd01bf407e312eaf184e569308..0bd20c7b3b2fd66b21723733a9dc5589bd50d4d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: before_script: - apt-get update --yes - - apt-get install --yes build-essential cmake libfmt-dev pybind11-dev graphviz python3-pyqt5 xvfb + - apt-get install --yes build-essential cmake libfmt-dev pybind11-dev graphviz python3-pyqt5 xvfb xdg-utils - python -m pip install --upgrade pip - python --version - pip install pytest pytest-cov sphinx furo numpydoc pytest-xvfb pytest-qt setuptools_scm sphinx-qt-documentation diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index 3a99b05176a1c3b5b943b20a12edeeb298f0f94b..d089311c3807a8f134e162094dd7323996f75105 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -1205,7 +1205,8 @@ class SFG(AbstractOperation): """ dg = Digraph() dg.attr(rankdir="LR") - dg.engine = 'dot' if engine is None else engine + if engine is not None: + dg.engine = engine for op in self._components_by_id.values(): if isinstance(op, Signal): if show_id: @@ -1249,4 +1250,8 @@ class SFG(AbstractOperation): """ dg = self.sfg(show_id=show_id) + if engine is not None: + dg.engine = engine + if format is not None: + dg.format = format dg.view() diff --git a/test/test_sfg.py b/test/test_sfg.py index 8c80b85a5f406edc9a3aabcc7a4b0849df062a96..a37caa79850a6f7adac237c68521790424a52a96 100644 --- a/test/test_sfg.py +++ b/test/test_sfg.py @@ -1398,9 +1398,9 @@ class TestSFGGraph: assert sfg_simple_filter.sfg(show_id=True).source == res def test_show_sfg_invalid_format(self, sfg_simple_filter): - with pytest.raises(AssertionError): + with pytest.raises(ValueError): sfg_simple_filter.show_sfg(format="ppddff") def test_show_sfg_invalid_engine(self, sfg_simple_filter): - with pytest.raises(AssertionError): + with pytest.raises(ValueError): sfg_simple_filter.show_sfg(engine="ppddff")