mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 10:24:38 +08:00
mypy for test/
This commit is contained in:
@@ -21,3 +21,5 @@ jobs:
|
||||
run: pip install tox
|
||||
- name: run tests
|
||||
run: tox -e lint
|
||||
- name: run mypy checks
|
||||
run: tox -e mypy
|
||||
|
||||
@@ -7,7 +7,7 @@ try:
|
||||
except ImportError:
|
||||
# Galaxy libraries and galaxy test driver not available, just assume we're
|
||||
# targetting a remote Galaxy.
|
||||
GalaxyTestDriver = None
|
||||
GalaxyTestDriver = None # type: ignore
|
||||
|
||||
|
||||
class ApiTestCase(FunctionalTestCase, UsesApiTestCaseMixin, TestCase):
|
||||
|
||||
@@ -16,3 +16,6 @@ exclude = lib/galaxy/util/jstree.py
|
||||
# https://github.com/PyCQA/flake8-import-order/blob/master/tests/test_cases/complete_smarkets.py
|
||||
import-order-style = smarkets
|
||||
application-import-names = galaxy,galaxy_test,tool_shed
|
||||
|
||||
[mypy]
|
||||
ignore_missing_imports = True
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
import string
|
||||
import subprocess
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -106,7 +107,7 @@ def stop_irods(container_name):
|
||||
|
||||
class BaseObjectstoreUploadTest(UploadTestDatatypeDataTestCase):
|
||||
|
||||
object_store_template = None
|
||||
object_store_template: Optional[string.Template] = None
|
||||
|
||||
@classmethod
|
||||
def handle_galaxy_config_kwds(cls, config):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.jobs.runners import (
|
||||
@@ -66,7 +67,7 @@ class AssertionJobRunner(LocalJobRunner):
|
||||
class FailOnlyFirstJobRunner(LocalJobRunner):
|
||||
"""Job runner that knows about test cases and checks final state assumptions."""
|
||||
|
||||
tests_seen = []
|
||||
tests_seen: List[str] = []
|
||||
|
||||
def queue_job(self, job_wrapper):
|
||||
resource_parameters = job_wrapper.get_resource_parameters()
|
||||
|
||||
@@ -6,7 +6,8 @@ from galaxy_test.driver import integration_util
|
||||
from tool_shed.util import hg_util
|
||||
from .uses_shed import UsesShed
|
||||
|
||||
REPO = namedtuple('Repository', 'name owner changeset')(
|
||||
REPO_TYPE = namedtuple('Repository', 'name owner changeset')
|
||||
REPO = REPO_TYPE(
|
||||
'collection_column_join',
|
||||
'iuc',
|
||||
'dfde09461b1e', # revision 2, a known installable revision
|
||||
|
||||
@@ -35,10 +35,11 @@ CONFIG_TEST_TOOL_VERSION_TEMPLATE = string.Template(
|
||||
CONFIG_TEST_TOOL_VERSION_1 = CONFIG_TEST_TOOL_VERSION_TEMPLATE.safe_substitute(dict(version="1"))
|
||||
CONFIG_TEST_TOOL_VERSION_2 = CONFIG_TEST_TOOL_VERSION_TEMPLATE.safe_substitute(dict(version="2"))
|
||||
|
||||
DEFAULT_TEST_REPO = collections.namedtuple(
|
||||
REPO_TYPE = collections.namedtuple(
|
||||
'DEFAULT_TEST_REPO',
|
||||
'tool_shed owner name changeset_revision installed_changeset_revision description status',
|
||||
)('github.com', 'galaxyproject', 'example', '1', '1', 'description', 'OK')
|
||||
)
|
||||
DEFAULT_TEST_REPO = REPO_TYPE('github.com', 'galaxyproject', 'example', '1', '1', 'description', 'OK')
|
||||
|
||||
|
||||
class BaseToolBoxTestCase(unittest.TestCase, UsesApp, UsesTools):
|
||||
|
||||
@@ -12,6 +12,8 @@ commands =
|
||||
lint_docstring_include_list: bash .ci/flake8_wrapper_docstrings.sh --include
|
||||
|
||||
unit: bash run_tests.sh -u
|
||||
# start with test here but obviously someday all of it...
|
||||
mypy: mypy test
|
||||
whitelist_externals = bash
|
||||
passenv =
|
||||
CI CONDA_EXE
|
||||
@@ -28,6 +30,7 @@ setenv =
|
||||
deps =
|
||||
lint,lint_docstring,lint_docstring_include_list: -rlib/galaxy/dependencies/pipfiles/flake8/pinned-requirements.txt
|
||||
unit: mock-ssh-server
|
||||
mypy: mypy
|
||||
|
||||
[testenv:mulled]
|
||||
commands = bash run_tests.sh --skip-venv -u test/unit/tool_util/mulled
|
||||
|
||||
Reference in New Issue
Block a user