diff --git a/lib/galaxy/util/lazy_process.py b/lib/galaxy/util/lazy_process.py index fbb6dcaac1b..4565296c572 100644 --- a/lib/galaxy/util/lazy_process.py +++ b/lib/galaxy/util/lazy_process.py @@ -30,6 +30,7 @@ class LazyProcess: with self.thread_lock: self.allow_process_request = False if self.running: + assert self.process # tell type checker it can not be None if self.running self.process.terminate() time.sleep(.01) if self.running: diff --git a/setup.cfg b/setup.cfg index ffa5d652aa9..bf46ca4e271 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,8 +32,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-galaxy_test.base.ssh_util] check_untyped_defs = False -[mypy-galaxy.util.lazy_process] -check_untyped_defs = False [mypy-galaxy.util.heartbeat] check_untyped_defs = False [mypy-galaxy.tools.bundled.stats.aggregate_scores_in_intervals] diff --git a/test/unit/util/test_lazy_process.py b/test/unit/util/test_lazy_process.py index c81dc76e867..108846450bc 100644 --- a/test/unit/util/test_lazy_process.py +++ b/test/unit/util/test_lazy_process.py @@ -15,6 +15,7 @@ def test_lazy_process(): lazy_process.start_process() while not os.path.exists(t.name): time.sleep(.01) + assert lazy_process.process assert lazy_process.process.poll() is None lazy_process.shutdown() ret_val = None