Files
galaxy/test/functional/test_data_managers.py
T
mvdbeek 9e07d9cc06 Handle driver shutdown, show all test in pytest
This is pretty hackish as fixtures can't be used during test discovery.
To properly shut down the driver I've added a conftest.py file that will
be called when quitting pytest. We might be able to handle this a
little better if we wrote a full plugin, but for now this works.

Also now reports all test indexes, so you can select e.g test 2 of a
tool.
2018-08-16 18:44:05 +02:00

45 lines
1.3 KiB
Python

import logging
from .test_toolbox import (
build_tests as _build_tests,
ToolTestCase,
)
try:
from nose.tools import nottest
except ImportError:
def nottest(x):
return x
log = logging.getLogger(__name__)
data_managers = None
class DataManagerToolTestCase(ToolTestCase):
"""Test case that runs Data Manager tests based on a `galaxy.tools.test.ToolTest`"""
@nottest
def build_tests(tmp_dir=None, testing_shed_tools=False, master_api_key=None, user_api_key=None, create_admin=False, user_email=None):
"""
If the module level variable `data_managers` is set, generate `DataManagerToolTestCase`
classes for all of its tests and put them into this modules globals() so
they can be discovered by nose.
"""
if data_managers is None:
log.warning('data_managers was not set for Data Manager functional testing. Will not test.')
return
G = globals()
_build_tests(testing_shed_tools=testing_shed_tools,
master_api_key=master_api_key,
user_api_key=user_api_key,
name_prefix="TestForDataManagerTool_",
baseclass=DataManagerToolTestCase,
user_email=user_email,
create_admin=create_admin,
G=G,
contains='data_manager')