diff --git a/contrib/nagios/check_galaxy.py b/contrib/nagios/check_galaxy.py index 57da403ec0f..d61ff42d84f 100755 --- a/contrib/nagios/check_galaxy.py +++ b/contrib/nagios/check_galaxy.py @@ -73,7 +73,7 @@ tc.agent("Mozilla/5.0 (compatible; check_galaxy/0.2)") tc.config('use_tidy', 0) -class Browser: +class Browser(object): def __init__(self): self.server = server self.handler = handler diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index 2d3a2a6b552..25be8b29ce3 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -230,7 +230,7 @@ class Strategy(BaseStrategy): return self.backend.continue_pipeline(*args, **kwargs) -class Storage: +class Storage(object): user = UserAuthnzToken nonce = PSANonce association = PSAAssociation diff --git a/lib/galaxy/tools/toolbox/base.py b/lib/galaxy/tools/toolbox/base.py index 34a131e6a7f..eb517789703 100644 --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -714,7 +714,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): def __watch_directory(self, directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=False): - def quick_load(tool_file, async=True): + def quick_load(tool_file, async_load=True): try: tool = self.load_tool(tool_file) self.__add_tool(tool, load_panel_dict, elems) @@ -722,7 +722,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): key = 'tool_%s' % str(tool.id) integrated_elems[key] = tool - if async: + if async_load: self._load_tool_panel() self._save_integrated_tool_panel() return tool.id @@ -739,7 +739,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): if os.path.isdir(child_path) and recursive: self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive) elif self._looks_like_a_tool(child_path): - quick_load(child_path, async=False) + quick_load(child_path, async_load=False) tool_loaded = True if (tool_loaded or force_watch) and self._tool_watcher: self._tool_watcher.watch_directory(directory, quick_load) diff --git a/lib/galaxy/tools/util/maf_utilities.py b/lib/galaxy/tools/util/maf_utilities.py index b2c25abb38d..3a5aa531bb2 100644 --- a/lib/galaxy/tools/util/maf_utilities.py +++ b/lib/galaxy/tools/util/maf_utilities.py @@ -731,7 +731,7 @@ def get_attributes_from_fasta_header(header): def iter_fasta_alignment(filename): - class fastaComponent: + class fastaComponent(object): def __init__(self, species, text=""): self.species = species self.text = text diff --git a/lib/galaxy/tools/verify/interactor.py b/lib/galaxy/tools/verify/interactor.py index 616e5b80622..f25760ffc4f 100644 --- a/lib/galaxy/tools/verify/interactor.py +++ b/lib/galaxy/tools/verify/interactor.py @@ -265,7 +265,7 @@ class GalaxyInteractorApi(object): output_id = output_data return output_id - def stage_data_async(self, test_data, history_id, tool_id, async=True): + def stage_data_async(self, test_data, history_id, tool_id): fname = test_data['fname'] tool_input = { "file_type": test_data['ftype'], diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py index 44e003585c1..94818e938a5 100644 --- a/lib/galaxy/tools/wrappers.py +++ b/lib/galaxy/tools/wrappers.py @@ -120,7 +120,7 @@ class SelectToolParameterWrapper(ToolParameterValueWrapper): attributes are accessible. """ - class SelectToolParameterFieldWrapper: + class SelectToolParameterFieldWrapper(object): """ Provide access to any field by name or index for this particular value. Only applicable for dynamic_options selects, which have more than simple 'options' defined (name, value, selected). @@ -182,7 +182,7 @@ class DatasetFilenameWrapper(ToolParameterValueWrapper): attributes are accessible. """ - class MetadataWrapper: + class MetadataWrapper(object): """ Wraps a Metadata Collection to return MetadataParameters wrapped according to the metadata spec. Methods implemented to match behavior diff --git a/lib/galaxy/util/streamball.py b/lib/galaxy/util/streamball.py index c25a9d26710..1ad22d630fb 100644 --- a/lib/galaxy/util/streamball.py +++ b/lib/galaxy/util/streamball.py @@ -33,7 +33,7 @@ class StreamBall(object): def stream(self, environ, start_response): response_write = start_response(self.wsgi_status, self.wsgi_headeritems) - class tarfileobj: + class tarfileobj(object): def write(self, *args, **kwargs): response_write(*args, **kwargs) tf = tarfile.open(mode=self.mode, fileobj=tarfileobj()) diff --git a/lib/galaxy/util/xml_macros.py b/lib/galaxy/util/xml_macros.py index 3f96a3dc94d..f03b8dac8b5 100644 --- a/lib/galaxy/util/xml_macros.py +++ b/lib/galaxy/util/xml_macros.py @@ -141,7 +141,7 @@ def _expand_macro(element, expand_el, macros, tokens): # require this parent_map data structure but elementtree does not # track parents or recongnize .find('..'). # TODO fix this now that we're not using elementtree - parent_map = dict((c, p) for p in element.getiterator() for c in p) + parent_map = dict((c, p) for p in element.iter() for c in p) _xml_replace(expand_el, expanded_elements, parent_map) @@ -150,7 +150,7 @@ def _expand_yield_statements(macro_def, expand_el): expand_el_children = list(expand_el) macro_def_parent_map = \ - dict((c, p) for macro_def_el in macro_def for p in macro_def_el.getiterator() for c in p) + dict((c, p) for macro_def_el in macro_def for p in macro_def_el.iter() for c in p) for yield_el in yield_els: _xml_replace(yield_el, expand_el_children, macro_def_parent_map) diff --git a/lib/galaxy/web/framework/base.py b/lib/galaxy/web/framework/base.py index dfc42e95508..b2ef292deb1 100644 --- a/lib/galaxy/web/framework/base.py +++ b/lib/galaxy/web/framework/base.py @@ -369,7 +369,7 @@ class Request(webob.Request): Create a new request wrapping the WSGI environment `environ` """ # self.environ = environ - webob.Request.__init__(self, environ, charset='utf-8', decode_param_names=False) + webob.Request.__init__(self, environ, charset='utf-8') # Properties that are computed and cached on first use @lazy_property diff --git a/pytest.ini b/pytest.ini index 6479864e5de..f01ebabefdb 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,7 @@ [pytest] addopts = --doctest-continue-on-failure log_level = DEBUG +python_classes = python_paths = lib markers = data_manager: marks test as a data_manager test diff --git a/scripts/api/library_upload_dir.py b/scripts/api/library_upload_dir.py index 84d321d6fc4..421f2d1b072 100644 --- a/scripts/api/library_upload_dir.py +++ b/scripts/api/library_upload_dir.py @@ -8,7 +8,7 @@ import sys from bioblend import galaxy -class Uploader: +class Uploader(object): def __init__(self, url, api, library_id, folder_id, should_link, non_local): diff --git a/scripts/apply_tags.py b/scripts/apply_tags.py index 1d118f19db0..e554d5b56ec 100644 --- a/scripts/apply_tags.py +++ b/scripts/apply_tags.py @@ -6,7 +6,7 @@ import time from bioblend.galaxy import GalaxyInstance -class ApplyTagsHistory: +class ApplyTagsHistory(object): @classmethod def __init__(self, galaxy_url, galaxy_api_key, history_id=None): diff --git a/scripts/check_galaxy.py b/scripts/check_galaxy.py index 6a6a8618015..22f96a6bf0c 100755 --- a/scripts/check_galaxy.py +++ b/scripts/check_galaxy.py @@ -107,7 +107,7 @@ tc.agent("Mozilla/5.0 (compatible; check_galaxy/0.1)") tc.config('use_tidy', 0) -class Browser: +class Browser(object): def __init__(self): self.server = server diff --git a/scripts/grt/export.py b/scripts/grt/export.py index 070eeef220b..5a8ee8c4c91 100644 --- a/scripts/grt/export.py +++ b/scripts/grt/export.py @@ -48,7 +48,7 @@ def kw_metrics(job): } -class Sanitization: +class Sanitization(object): def __init__(self, sanitization_config, model, sa_session): self.sanitization_config = sanitization_config diff --git a/scripts/loc_files/create_all_fasta_loc.py b/scripts/loc_files/create_all_fasta_loc.py index 3feefd17927..7fd4b9c8587 100644 --- a/scripts/loc_files/create_all_fasta_loc.py +++ b/scripts/loc_files/create_all_fasta_loc.py @@ -205,11 +205,11 @@ def __main__(): loc_path = None tree = parse(options.data_table_xml) tables = tree.getroot() - for table in tables.getiterator(): + for table in tables.iter(): name = table.attrib.get('name') if name == options.data_table_name: cols = None - for node in table.getiterator(): + for node in table.iter(): if node.tag == 'columns': cols = node.text elif node.tag == 'file': diff --git a/scripts/microbes/util.py b/scripts/microbes/util.py index 55021f43480..1e4f7b3650c 100644 --- a/scripts/microbes/util.py +++ b/scripts/microbes/util.py @@ -7,7 +7,7 @@ assert sys.version_info[:2] >= (2, 4) # genbank_to_bed -class Region: +class Region(object): def __init__(self): self.qualifiers = {} self.start = None @@ -37,7 +37,7 @@ class Region: self.end = end -class GenBankFeatureParser: +class GenBankFeatureParser(object): """Parses Features from Single Locus GenBank file""" def __init__(self, fh, features_list=[]): self.fh = fh diff --git a/test/base/api.py b/test/base/api.py index 57b078ec83d..9ec0a7e44a2 100644 --- a/test/base/api.py +++ b/test/base/api.py @@ -19,7 +19,7 @@ from .interactor import TestCaseGalaxyInteractor as BaseInteractor from .testcase import FunctionalTestCase -class UsesApiTestCaseMixin: +class UsesApiTestCaseMixin(object): def _api_url(self, path, params=None, use_key=None, use_admin_key=None): if not params: diff --git a/test/base/populators.py b/test/base/populators.py index c3cc68e477e..ed0bb33a864 100644 --- a/test/base/populators.py +++ b/test/base/populators.py @@ -140,7 +140,7 @@ def _raise_skip_if(check): # Deprecated mixin, use dataset populator instead. # TODO: Rework existing tests to target DatasetPopulator in a setup method instead. -class TestsDatasets: +class TestsDatasets(object): def _new_dataset(self, history_id, content='TestData123', **kwds): return DatasetPopulator(self.galaxy_interactor).new_dataset(history_id, content=content, **kwds) @@ -1087,7 +1087,7 @@ def wait_on_state(state_func, desc="state", skip_states=["running", "queued", "n raise TimeoutAssertionError("%s Current response containing state [%s]." % (str(e), response.json())) -class GiPostGetMixin: +class GiPostGetMixin(object): """Mixin for adapting Galaxy testing populators helpers to bioblend.""" def _get(self, route, data={}): diff --git a/test/galaxy_selenium/has_driver.py b/test/galaxy_selenium/has_driver.py index 447ff3fd83d..0bdf77547a6 100644 --- a/test/galaxy_selenium/has_driver.py +++ b/test/galaxy_selenium/has_driver.py @@ -14,7 +14,7 @@ from selenium.webdriver.support.ui import WebDriverWait UNSPECIFIED_TIMEOUT = object() -class HasDriver: +class HasDriver(object): TimeoutException = TimeoutException def assert_xpath(self, xpath): diff --git a/test/integration/test_job_environments.py b/test/integration/test_job_environments.py index 7d2ef8cffa2..7ce81fc2e1a 100644 --- a/test/integration/test_job_environments.py +++ b/test/integration/test_job_environments.py @@ -24,7 +24,7 @@ JobEnviromentProperties = collections.namedtuple("JobEnvironmentProperties", [ ]) -class RunsEnvironmentJobs: +class RunsEnvironmentJobs(object): def _run_and_get_environment_properties(self, tool_id="job_environment_default"): with self.dataset_populator.test_history() as history_id: diff --git a/test/selenium_tests/framework.py b/test/selenium_tests/framework.py index 26c07fb0ec8..87569eda3ef 100644 --- a/test/selenium_tests/framework.py +++ b/test/selenium_tests/framework.py @@ -431,7 +431,7 @@ class SharedStateSeleniumTestCase(SeleniumTestCase): """Override this to setup shared data for tests that gets initialized only once.""" -class UsesHistoryItemAssertions: +class UsesHistoryItemAssertions(object): def assert_item_peek_includes(self, hid, expected): item_body = self.history_panel_item_component(hid=hid) @@ -508,7 +508,7 @@ def get_remote_driver(): ) -class SeleniumSessionGetPostMixin: +class SeleniumSessionGetPostMixin(object): """Mixin for adapting Galaxy testing populators helpers to Selenium session backed bioblend.""" def _get(self, route, data={}): diff --git a/test/unit/tools/test_evaluation.py b/test/unit/tools/test_evaluation.py index 0aaa3aeb038..76c63d98216 100644 --- a/test/unit/tools/test_evaluation.py +++ b/test/unit/tools/test_evaluation.py @@ -194,7 +194,7 @@ class ToolEvaluatorTestCase(TestCase, UsesApp): kwds["working_directory"] = self.test_directory if "new_file_path" not in kwds: kwds["new_file_path"] = self.app.config.new_file_path - self.evaluator.set_compute_environment(TestComputeEnviornment(**kwds)) + self.evaluator.set_compute_environment(TestComputeEnvironment(**kwds)) assert "exec_before_job" in self.tool.hooks_called def _setup_test_bwa_job(self): @@ -218,7 +218,7 @@ class MockHistoryDatasetAssociation(HistoryDatasetAssociation): super(MockHistoryDatasetAssociation, self).__init__(**kwds) -class TestComputeEnviornment(SimpleComputeEnvironment): +class TestComputeEnvironment(SimpleComputeEnvironment): def __init__( self, @@ -256,7 +256,7 @@ class TestComputeEnviornment(SimpleComputeEnvironment): if self._path_rewriter: return self._path_rewriter else: - return super(TestComputeEnviornment, self).unstructured_path_rewriter() + return super(TestComputeEnvironment, self).unstructured_path_rewriter() def tool_directory(self): return TEST_TOOL_DIRECTORY diff --git a/tools/filters/join.py b/tools/filters/join.py index e2094bc9b63..13f820199d3 100644 --- a/tools/filters/join.py +++ b/tools/filters/join.py @@ -20,7 +20,7 @@ from galaxy.util import stringify_dictionary_keys from galaxy.util.bunch import Bunch -class OffsetList: +class OffsetList(object): def __init__(self, filesize=0, fmt=None): self.file = tempfile.NamedTemporaryFile('w+b') if fmt: @@ -146,7 +146,7 @@ class SortedOffsets(OffsetList): # indexed set of offsets, index is built on demand -class OffsetIndex: +class OffsetIndex(object): def __init__(self, filename, column, split=None, index_depth=3): self.filename = filename self.file = open(filename, 'r') @@ -239,7 +239,7 @@ class OffsetIndex: first_char = identifier[0] -class BufferedIndex: +class BufferedIndex(object): def __init__(self, filename, column, split=None, buffer=1000000, index_depth=3): self.index = OffsetIndex(filename, column, split, index_depth) self.buffered_offsets = {} diff --git a/tools/filters/sff_extract.py b/tools/filters/sff_extract.py index cfb0cb53afa..98620572776 100644 --- a/tools/filters/sff_extract.py +++ b/tools/filters/sff_extract.py @@ -1180,7 +1180,7 @@ def read_ssaha_data(ssahadata_fh): # ########################################################################## -class Fasta: +class Fasta(object): def __init__(self, name, sequence): self.name = name self.sequence = sequence diff --git a/tools/phenotype_association/senatag.py b/tools/phenotype_association/senatag.py index d4637838d2b..8a7a8c08dcd 100755 --- a/tools/phenotype_association/senatag.py +++ b/tools/phenotype_association/senatag.py @@ -37,7 +37,7 @@ debug_flag = False @total_ordering -class node: +class node(object): def __init__(self, name): self.name = name self.edges = [] @@ -65,7 +65,7 @@ class node: return self.name -class graph: +class graph(object): def __init__(self): self.nodes = {} diff --git a/tools/stats/aggregate_scores_in_intervals.py b/tools/stats/aggregate_scores_in_intervals.py index 704c4ae80d6..9c0cceba15b 100755 --- a/tools/stats/aggregate_scores_in_intervals.py +++ b/tools/stats/aggregate_scores_in_intervals.py @@ -25,7 +25,7 @@ from bx.cookbook import doc_optparse from galaxy.util.ucsc import UCSCLimitException, UCSCOutWrapper -class PositionalScoresOnDisk: +class PositionalScoresOnDisk(object): fmt = 'f' fmt_size = struct.calcsize(fmt) default_value = float('nan')