Skip to content

Commit f94f42a

Browse files
committed
Lint dependencies.
1 parent 414b994 commit f94f42a

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,12 @@ repos:
6262
hooks:
6363
- id: yapf-isort
6464
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.py$
65+
66+
# Custom hooks can be added below this comment
67+
68+
- repo: https://github.com/domdfcoding/dep_checker
69+
rev: v0.3.1
70+
hooks:
71+
- id: dep_checker
72+
args:
73+
- domdf_python_tools

domdf_python_tools/testing.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
from typing import Any, Iterator, List, Optional, Sequence, Tuple, Union
3939

4040
# 3rd party
41-
import _pytest
42-
import pytest
43-
from _pytest.mark import MarkDecorator
41+
import pytest # nodep
42+
from _pytest.mark import MarkDecorator # nodep
4443

4544
# this package
4645
from domdf_python_tools.doctools import PYPY
@@ -239,7 +238,7 @@ def _make_version(version: Union[str, float, Tuple[int, ...]]) -> Version:
239238
def min_version(
240239
version: Union[str, float, Tuple[int]],
241240
reason: Optional[str] = None,
242-
) -> _pytest.mark.structures.MarkDecorator:
241+
) -> MarkDecorator:
243242
"""
244243
Factory function to return a ``@pytest.mark.skipif`` decorator that will
245244
skip a test if the current Python version is less than the required one.
@@ -264,7 +263,7 @@ def min_version(
264263
def max_version(
265264
version: Union[str, float, Tuple[int]],
266265
reason: Optional[str] = None,
267-
) -> _pytest.mark.structures.MarkDecorator:
266+
) -> MarkDecorator:
268267
"""
269268
Factory function to return a ``@pytest.mark.skipif`` decorator that will
270269
skip a test if the current Python version is greater than the required one.
@@ -286,7 +285,7 @@ def max_version(
286285
return pytest.mark.skipif(condition=sys.version_info[:3] > version_, reason=reason)
287286

288287

289-
def not_windows(reason: str = "Not required on Windows.", ) -> _pytest.mark.structures.MarkDecorator:
288+
def not_windows(reason: str = "Not required on Windows.", ) -> MarkDecorator:
290289
"""
291290
Factory function to return a ``@pytest.mark.skipif`` decorator that will
292291
skip a test if the current platform is Windows.
@@ -301,7 +300,7 @@ def not_windows(reason: str = "Not required on Windows.", ) -> _pytest.mark.stru
301300
return pytest.mark.skipif(condition=sys.platform == "win32", reason=reason)
302301

303302

304-
def only_windows(reason: str = "Only required on Windows.", ) -> _pytest.mark.structures.MarkDecorator:
303+
def only_windows(reason: str = "Only required on Windows.", ) -> MarkDecorator:
305304
"""
306305
Factory function to return a ``@pytest.mark.skipif`` decorator that will
307306
skip a test if the current platform is **not** Windows.
@@ -316,7 +315,7 @@ def only_windows(reason: str = "Only required on Windows.", ) -> _pytest.mark.st
316315
return pytest.mark.skipif(condition=sys.platform != "win32", reason=reason)
317316

318317

319-
def not_pypy(reason: str = "Not required on PyPy.") -> _pytest.mark.structures.MarkDecorator:
318+
def not_pypy(reason: str = "Not required on PyPy.") -> MarkDecorator:
320319
"""
321320
Factory function to return a ``@pytest.mark.skipif`` decorator that will
322321
skip a test if the current Python implementation is PyPy.
@@ -331,7 +330,7 @@ def not_pypy(reason: str = "Not required on PyPy.") -> _pytest.mark.structures.M
331330
return pytest.mark.skipif(condition=PYPY, reason=reason)
332331

333332

334-
def only_pypy(reason: str = "Only required on PyPy.") -> _pytest.mark.structures.MarkDecorator:
333+
def only_pypy(reason: str = "Only required on PyPy.") -> MarkDecorator:
335334
"""
336335
Factory function to return a ``@pytest.mark.skipif`` decorator that will
337336
skip a test if the current Python implementation is not PyPy.

0 commit comments

Comments
 (0)