Skip to content

Commit

Permalink
Test for dot binary
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Aug 29, 2023
1 parent 1d81b18 commit 2ff85a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.7"
- name: Install graphviz on Linux
run: sudo apt install -y graphviz

- name: Install normally
run: make install
Expand All @@ -86,8 +84,6 @@ jobs:
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
- name: Install graphviz on Linux
run: sudo apt install -y graphviz

link_check:
runs-on: ubuntu-latest
Expand Down
8 changes: 5 additions & 3 deletions metakernel/magics/tests/test_dot_magic.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import sys
import shutil

from metakernel.tests.utils import (get_kernel, get_log_text,
clear_log_text, EvalKernel)

import pytest

@pytest.mark.skipif(sys.platform != "linux", reason="Requires dot from grahviz")
NO_DOT = shutil.which("dot") is None

@pytest.mark.skipif(NO_DOT, reason="Requires dot from graphviz")
def test_dot_magic_cell():
kernel = get_kernel(EvalKernel)
kernel.do_execute("""%%dot
Expand All @@ -16,7 +18,7 @@ def test_dot_magic_cell():
text = get_log_text(kernel)
assert "Display Data" in text, text

@pytest.mark.skipif(sys.platform != "linux", reason="Requires dot from grahviz")
@pytest.mark.skipif(NO_DOT, reason="Requires dot from graphviz")
def test_dot_magic_line():
kernel = get_kernel(EvalKernel)
kernel.do_execute("%dot graph A { a->b };")
Expand Down

0 comments on commit 2ff85a3

Please sign in to comment.