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

[WIP] Implement serve flag for planemo test #1185

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion planemo/commands/cmd_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Module describing the planemo ``test`` command."""
from contextlib import ExitStack

import click

from planemo import options
Expand Down Expand Up @@ -66,7 +68,11 @@ def cli(ctx, uris, **kwds):
against that same Galaxy root - but this may not be bullet proof yet so
please careful and do not try this against production Galaxy instances.
"""
with temp_directory(dir=ctx.planemo_directory) as temp_path:
with ExitStack() as stack:
if not kwds["serve"]:
temp_path = stack.enter_context(temp_directory(dir=ctx.planemo_directory))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fascinating! I had no clue about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, new for me as well, I came across it while searching for a way to write a conditional with statement.

else:
temp_path = None
# Create temp dir(s) outside of temp, docker can't mount $TEMPDIR on OSX
runnables = for_runnable_identifiers(ctx, uris, kwds, temp_path=temp_path)

Expand Down