Skip to content

Commit f713984

Browse files
author
ever3001
committed
fix(mypy): remove unused "type: ignore" comments in tests
Configured mypy to recognize pytest library by adding pytest plugin to mypy configuration. This allows mypy to properly type-check pytest fixtures and decorators, eliminating the need for "type: ignore" comments in test files.
1 parent 58e306c commit f713984

21 files changed

+21
-21
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from urllib.error import HTTPError, URLError
1212
from urllib.request import urlopen
1313

14-
import pytest # type: ignore[import-not-found]
14+
import pytest
1515

1616
from helpers import WIN
1717
from pipx import commands, interpreter, paths, shared_libs, standalone_python, venv

tests/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Any, Dict, List, Optional
88
from unittest import mock
99

10-
import pytest # type: ignore[import-not-found]
10+
import pytest
1111
from packaging.utils import canonicalize_name
1212

1313
from package_info import PKG

tests/test_animate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import time
22

3-
import pytest # type: ignore[import-not-found]
3+
import pytest
44

55
import pipx.animate
66
from pipx.animate import (

tests/test_emojis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from io import BytesIO, TextIOWrapper
33
from unittest import mock
44

5-
import pytest # type: ignore[import-not-found]
5+
import pytest
66

77
from pipx.emojis import use_emojis
88

tests/test_inject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
import textwrap
44

5-
import pytest # type: ignore[import-not-found]
5+
import pytest
66

77
from helpers import PIPX_METADATA_LEGACY_VERSIONS, mock_legacy_venv, run_pipx_cli, skip_if_windows
88
from package_info import PKG

tests/test_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from unittest import mock
77

8-
import pytest # type: ignore[import-not-found]
8+
import pytest
99

1010
from helpers import app_name, run_pipx_cli, skip_if_windows, unwrap_log_text
1111
from package_info import PKG

tests/test_install_all_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pathlib import Path
2525
from typing import List, Optional, Tuple
2626

27-
import pytest # type: ignore[import-not-found]
27+
import pytest
2828

2929
from helpers import run_pipx_cli
3030
from package_info import PKG

tests/test_interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from unittest.mock import Mock
55

6-
import pytest # type: ignore[import-not-found]
6+
import pytest
77

88
import pipx.interpreter
99
import pipx.paths

tests/test_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import time
77

8-
import pytest # type: ignore[import-not-found]
8+
import pytest
99

1010
from helpers import (
1111
PIPX_METADATA_LEGACY_VERSIONS,

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from unittest import mock
33

4-
import pytest # type: ignore[import-not-found]
4+
import pytest
55

66
from helpers import run_pipx_cli
77
from pipx import main

0 commit comments

Comments
 (0)