-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated dot magic, with tests (#268)
* Updated dot magic, with tests * Added pydot to docs/requirements.txt; is this right place? * Get the dot command from graphviz * install graphviz on linux only * Skip dot tests if not on linux --------- Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
- Loading branch information
Showing
5 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ requests | |
sphinx_bootstrap_theme | ||
numpydoc | ||
myst-parser | ||
pydot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
|
||
__all__ = ['Magic', 'MetaKernel', 'option'] | ||
|
||
__version__ = '0.29.5' | ||
__version__ = '0.29.6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
|
||
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") | ||
def test_dot_magic_cell(): | ||
kernel = get_kernel(EvalKernel) | ||
kernel.do_execute("""%%dot | ||
graph A { a->b }; | ||
""") | ||
|
||
text = get_log_text(kernel) | ||
assert "Display Data" in text, text | ||
|
||
@pytest.mark.skipif(sys.platform != "linux", reason="Requires dot from grahviz") | ||
def test_dot_magic_line(): | ||
kernel = get_kernel(EvalKernel) | ||
kernel.do_execute("%dot graph A { a->b };") | ||
|
||
text = get_log_text(kernel) | ||
assert "Display Data" in text, text |