From 3b484e75a0bd66062566fc364f7957eee70f6d68 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 30 Aug 2023 22:01:21 -0400 Subject: [PATCH] style: `from __future__ import annotations` in every .py file with code --- coverage/__init__.py | 2 ++ coverage/__main__.py | 2 ++ coverage/exceptions.py | 1 + coverage/multiproc.py | 2 ++ tests/test_oddball.py | 2 ++ tests/test_phystokens.py | 2 ++ 6 files changed, 11 insertions(+) diff --git a/coverage/__init__.py b/coverage/__init__.py index e3ed23223..d22d09deb 100644 --- a/coverage/__init__.py +++ b/coverage/__init__.py @@ -9,6 +9,8 @@ """ +from __future__ import annotations + # mypy's convention is that "import as" names are public from the module. # We import names as themselves to indicate that. Pylint sees it as pointless, # so disable its warning. diff --git a/coverage/__main__.py b/coverage/__main__.py index 79aa4e2b3..ce2d8dbd3 100644 --- a/coverage/__main__.py +++ b/coverage/__main__.py @@ -3,6 +3,8 @@ """Coverage.py's main entry point.""" +from __future__ import annotations + import sys from coverage.cmdline import main sys.exit(main()) diff --git a/coverage/exceptions.py b/coverage/exceptions.py index 43dc00477..ecd1b5e64 100644 --- a/coverage/exceptions.py +++ b/coverage/exceptions.py @@ -3,6 +3,7 @@ """Exceptions coverage.py can raise.""" +from __future__ import annotations class _BaseCoverageException(Exception): """The base-base of all Coverage exceptions.""" diff --git a/coverage/multiproc.py b/coverage/multiproc.py index 2fd8ad5dc..860b71305 100644 --- a/coverage/multiproc.py +++ b/coverage/multiproc.py @@ -3,6 +3,8 @@ """Monkey-patching to add multiprocessing support for coverage.py""" +from __future__ import annotations + import multiprocessing import multiprocessing.process import os diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 9fecf758a..e132d5aac 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -3,6 +3,8 @@ """Oddball cases for testing coverage.py""" +from __future__ import annotations + import os.path import re import sys diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 2f1f73071..0312189df 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -3,6 +3,8 @@ """Tests for coverage.py's improved tokenizer.""" +from __future__ import annotations + import os.path import re import textwrap