diff options
author | Matt Clay <matt@mystile.com> | 2024-08-06 04:30:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 04:30:37 +0200 |
commit | ac5ed40a212d25ab7f3128405a1217a5c421a116 (patch) | |
tree | bc000db3cfb97a8d62ff57dd82e7096579299dc5 /test/lib | |
parent | ansible-test - Update coverage to 7.6.1 (#83723) (diff) | |
download | ansible-ac5ed40a212d25ab7f3128405a1217a5c421a116.tar.xz ansible-ac5ed40a212d25ab7f3128405a1217a5c421a116.zip |
Fix type hints and misc mypy/pylint issues (#83724)
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/ansible_test/_internal/timeout.py | 2 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/util_common.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/test/lib/ansible_test/_internal/timeout.py b/test/lib/ansible_test/_internal/timeout.py index 2c57d4cf82..3f90c49fb2 100644 --- a/test/lib/ansible_test/_internal/timeout.py +++ b/test/lib/ansible_test/_internal/timeout.py @@ -118,7 +118,7 @@ def configure_test_timeout(args: TestConfig) -> None: raise TimeoutExpiredError(f'Tests aborted after exceeding the {timeout.duration} minute time limit.') - def timeout_waiter(timeout_seconds: int) -> None: + def timeout_waiter(timeout_seconds: float) -> None: """Background thread which will kill the current process if the timeout elapses.""" time.sleep(timeout_seconds) os.kill(os.getpid(), signal.SIGUSR1) diff --git a/test/lib/ansible_test/_internal/util_common.py b/test/lib/ansible_test/_internal/util_common.py index dfda54593e..98d9c23965 100644 --- a/test/lib/ansible_test/_internal/util_common.py +++ b/test/lib/ansible_test/_internal/util_common.py @@ -269,7 +269,10 @@ def named_temporary_file(args: CommonConfig, prefix: str, suffix: str, directory tempfile_fd.write(to_bytes(content)) tempfile_fd.flush() - yield tempfile_fd.name + try: + yield tempfile_fd.name + finally: + pass def write_json_test_results( |