Skip to content

Commit

Permalink
Ignore "unreachable" false-positives from mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jan 11, 2022
1 parent 23bcccc commit ba72e85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_migration(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
)
assert statefile.path == tmp_path / STATE_FILE
assert not statefile.migrating
assert statefile.modified
assert statefile.modified # type: ignore[unreachable]
with open(STATE_FILE) as fp:
data = json.load(fp)
assert data == {
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_defaulting(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
assert os.listdir() == [STATE_FILE]
assert statefile.state == State(github=newdt, travis=None, appveyor=None)
assert statefile.modified
with open(STATE_FILE) as fp:
with open(STATE_FILE) as fp: # type: ignore[unreachable]
data = json.load(fp)
assert data == {
"github": "2021-06-11T14:55:01+00:00",
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_empty(contents: str, monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -
assert os.listdir() == [STATE_FILE]
assert statefile.state == State(github=newdt, travis=None, appveyor=None)
assert statefile.modified
with f.open() as fp:
with f.open() as fp: # type: ignore[unreachable]
data = json.load(fp)
assert data == {
"github": "2021-06-11T14:55:01+00:00",
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_populated_explicit_path(tmp_path: Path) -> None:
assert statefile.path == f
assert not statefile.migrating
assert statefile.modified
with f.open() as fp:
with f.open() as fp: # type: ignore[unreachable]
data = json.load(fp)
assert data == {
"github": "2021-06-11T15:11:50+00:00",
Expand Down

0 comments on commit ba72e85

Please sign in to comment.