Skip to content

Commit

Permalink
Fix linting, annotate training tests requiring Galaxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 11, 2018
1 parent 45cd23a commit f383233
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 2 additions & 3 deletions planemo/training/tutorial.py
Expand Up @@ -4,11 +4,12 @@
import json
import os
import re
import six
import shutil
from pprint import pprint

import oyaml as yaml
import requests
import six

from planemo import templates
from planemo.bioblend import galaxy
Expand All @@ -28,8 +29,6 @@
save_to_yaml
)

from pprint import pprint

TUTO_HAND_ON_TEMPLATE = """---
layout: tutorial_hands_on
Expand Down
6 changes: 5 additions & 1 deletion tests/test_training.py
Expand Up @@ -8,7 +8,10 @@
from planemo import cli
from planemo.runnable import for_path
from planemo.training import Training
from .test_utils import TEST_DATA_DIR
from .test_utils import (
skip_if_environ,
TEST_DATA_DIR,
)


datatype_fp = os.path.join(TEST_DATA_DIR, "training_datatypes.yaml")
Expand Down Expand Up @@ -216,6 +219,7 @@ def test_fill_data_library():
shutil.rmtree("metadata")


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_generate_tuto_from_wf():
"""Test :func:`planemo.training.generate_tuto_from_wf`."""
train = Training(KWDS)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_training_tutorial.py
Expand Up @@ -36,6 +36,9 @@
wf_param_values,
zenodo_link
)
from .test_utils import (
skip_if_environ,
)

topic = Topic()
training = Training(KWDS)
Expand Down Expand Up @@ -105,6 +108,7 @@ def test_get_wf_param_values():
assert k in wf_param_value_tests


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_format_wf_steps():
"""Test :func:`planemo.training.tutorial.format_wf_steps`."""
assert is_galaxy_engine(**KWDS)
Expand All @@ -118,6 +122,7 @@ def test_format_wf_steps():
assert '## Sub-step with **Select first**' in body


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_get_hands_on_boxes_from_local_galaxy():
"""Test :func:`planemo.training.tutorial.get_hands_on_boxes_from_local_galaxy`."""
tuto_body = get_hands_on_boxes_from_local_galaxy(KWDS, WF_FP, CTX)
Expand All @@ -126,6 +131,7 @@ def test_get_hands_on_boxes_from_local_galaxy():
assert '## Sub-step with **Select first**' in tuto_body


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_get_hands_on_boxes_from_running_galaxy():
"""Test :func:`planemo.training.tutorial.get_hands_on_boxes_from_running_galaxy`."""
assert is_galaxy_engine(**KWDS)
Expand Down Expand Up @@ -299,6 +305,7 @@ def test_tutorial_has_workflow():
assert tuto.has_workflow()


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_tutorial_export_workflow_file():
"""Test :func:`planemo.training.tutorial.tutorial.export_workflow_file`."""
tuto = Tutorial(
Expand Down Expand Up @@ -380,6 +387,7 @@ def test_tutorial_write_hands_on_tutorial():
shutil.rmtree("topics")


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_tutorial_create_hands_on_tutorial():
"""Test :func:`planemo.training.tutorial.tutorial.create_hands_on_tutorial`."""
tuto = Tutorial(
Expand Down Expand Up @@ -416,6 +424,7 @@ def test_tutorial_create_hands_on_tutorial():
shutil.rmtree("topics")


@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_tutorial_create_tutorial():
"""Test :func:`planemo.training.tutorial.tutorial.create_tutorial`."""
tuto = Tutorial(
Expand Down

0 comments on commit f383233

Please sign in to comment.