Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualization test crashes if dot not installed #3390

Open
heplesser opened this issue Jan 10, 2025 · 1 comment
Open

Visualization test crashes if dot not installed #3390

heplesser opened this issue Jan 10, 2025 · 1 comment
Labels
good first issue Good for newcomers I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Bug Wrong statements in the code or documentation

Comments

@heplesser
Copy link
Contributor

The network visualization tests crashes if dot is not available. The test has a condition on pydot being importable

import pydot # noqa: F401
HAVE_PYDOT = True
except ImportError:
HAVE_PYDOT = False
try:

but this does not check if there actually is a runable dot available. To do this, one would need to add a try containing

pydot.Dot().write_png('foo.png')

catching FileNotFoundError and a cleanup removing foo.png if the writing succeeded.

@heplesser heplesser added T: Bug Wrong statements in the code or documentation S: Normal Handle this with default priority I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) good first issue Good for newcomers labels Jan 10, 2025
@heplesser heplesser added this to PyNEST Jan 10, 2025
@github-project-automation github-project-automation bot moved this to To do in PyNEST Jan 10, 2025
@med-ayssar
Copy link
Contributor

shutil.which("exe_name") is None would be a much easier solution to find whether an executable is available under PATH or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Bug Wrong statements in the code or documentation
Projects
Status: To do
Development

No branches or pull requests

2 participants