Skip to content

Commit

Permalink
mypy: test_annotate.py test_arcs.py test_collector.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 3, 2023
1 parent 2090f79 commit 0b05b45
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 102 deletions.
12 changes: 6 additions & 6 deletions tests/test_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class AnnotationGoldTest(CoverageTest):
"""Test the annotate feature with gold files."""

def make_multi(self):
def make_multi(self) -> None:
"""Make a few source files we need for the tests."""
self.make_file("multi.py", """\
import a.a
Expand All @@ -36,23 +36,23 @@ def b(x):
print(msg)
""")

def test_multi(self):
def test_multi(self) -> None:
self.make_multi()
cov = coverage.Coverage()
self.start_import_stop(cov, "multi")
cov.annotate()

compare(gold_path("annotate/multi"), ".", "*,cover")

def test_annotate_dir(self):
def test_annotate_dir(self) -> None:
self.make_multi()
cov = coverage.Coverage(source=["."])
self.start_import_stop(cov, "multi")
cov.annotate(directory="out_anno_dir")

compare(gold_path("annotate/anno_dir"), "out_anno_dir", "*,cover")

def test_encoding(self):
def test_encoding(self) -> None:
self.make_file("utf8.py", """\
# -*- coding: utf-8 -*-
# This comment has an accent: é
Expand All @@ -64,7 +64,7 @@ def test_encoding(self):
cov.annotate()
compare(gold_path("annotate/encodings"), ".", "*,cover")

def test_white(self):
def test_white(self) -> None:
self.make_file("white.py", """\
# A test case sent to me by Steve White
Expand Down Expand Up @@ -106,7 +106,7 @@ def h(x):
cov.annotate()
compare(gold_path("annotate/white"), ".", "*,cover")

def test_missing_after_else(self):
def test_missing_after_else(self) -> None:
self.make_file("mae.py", """\
def f(x):
if x == 1:
Expand Down
Loading

0 comments on commit 0b05b45

Please sign in to comment.