Skip to content

Commit

Permalink
style: from __future__ import annotations in every .py file with code
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Aug 31, 2023
1 parent 86955f2 commit 3b484e7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coverage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions coverage/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

"""Coverage.py's main entry point."""

from __future__ import annotations

import sys
from coverage.cmdline import main
sys.exit(main())
1 change: 1 addition & 0 deletions coverage/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"""Exceptions coverage.py can raise."""

from __future__ import annotations

class _BaseCoverageException(Exception):
"""The base-base of all Coverage exceptions."""
Expand Down
2 changes: 2 additions & 0 deletions coverage/multiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

"""Monkey-patching to add multiprocessing support for coverage.py"""

from __future__ import annotations

import multiprocessing
import multiprocessing.process
import os
Expand Down
2 changes: 2 additions & 0 deletions tests/test_oddball.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

"""Oddball cases for testing coverage.py"""

from __future__ import annotations

import os.path
import re
import sys
Expand Down
2 changes: 2 additions & 0 deletions tests/test_phystokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

"""Tests for coverage.py's improved tokenizer."""

from __future__ import annotations

import os.path
import re
import textwrap
Expand Down

0 comments on commit 3b484e7

Please sign in to comment.