Skip to content

Commit

Permalink
Update tests.yml (#270)
Browse files Browse the repository at this point in the history
* Update tests.yml

* Add graphviz where needed

* Add graphviz where needed

* Test for dot binary
  • Loading branch information
dsblank committed Aug 29, 2023
1 parent 1dff94e commit c9350d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install graphviz on Linux
if: ${{ startsWith("ubuntu", matrix.os }}
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: sudo apt install -y graphviz

- name: Install dependencies
run: |
pip install coveralls
Expand All @@ -58,6 +58,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.7"

- name: Install normally
run: make install
- name: Install minimum versions
Expand All @@ -74,6 +75,7 @@ jobs:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1


test_sdist:
runs-on: ubuntu-latest
needs: [make_sdist]
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 c9350d3

Please sign in to comment.