Skip to content

Commit

Permalink
✅ Use tmpdir for Gantt test
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jan 8, 2021
1 parent f982076 commit fa65caf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nipype/pipeline/plugins/tests/test_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_callback_gantt(tmpdir, plugin):
from nipype.utils.profiler import log_nodes_cb
from nipype.utils.draw_gantt_chart import generate_gantt_chart

log_filename = "callback.log"
log_filename = path.join(tmpdir, "callback.log")
logger = logging.getLogger("callback")
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_filename)
Expand All @@ -92,5 +92,7 @@ def test_callback_gantt(tmpdir, plugin):
plugin_args["n_procs"] = 8
wf.run(plugin=plugin, plugin_args=plugin_args)

generate_gantt_chart("callback.log", 1 if plugin == "Linear" else 8)
assert path.exists("callback.log.html")
generate_gantt_chart(
path.join(tmpdir, "callback.log"), 1 if plugin == "Linear" else 8
)
assert path.exists(path.join(tmpdir, "callback.log.html"))

0 comments on commit fa65caf

Please sign in to comment.