FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: enable mypy for tests/meta/* by JohnVillalovos · Pull Request #1693 · python-gitlab/python-gitlab · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .toml  (1) .txt  (1) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 0 additions & 1 deletion pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module = [
"gitlab.v4.objects.sidekiq",
"tests.functional.*",
"tests.functional.api.*",
"tests.meta.*",
"tests.unit.*",
"tests.smoke.*"
]
Expand Down
2 changes: 2 additions & 0 deletions requirements-lint.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ black==20.8b1
flake8==4.0.1
isort==5.10.1
mypy==0.910
pytest
types-PyYAML==6.0.1
types-requests==2.26.0
types-setuptools==57.4.2
types-toml==0.10.1
5 changes: 3 additions & 2 deletions tests/meta/test_ensure_type_hints.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import inspect
from typing import Tuple, Type

import _pytest
import toml

import gitlab.mixins
import gitlab.v4.objects


def pytest_generate_tests(metafunc):
def pytest_generate_tests(metafunc: _pytest.python.Metafunc) -> None:
"""Find all of the classes in gitlab.v4.objects and pass them to our test
function"""

Expand Down Expand Up @@ -54,7 +55,7 @@ def pytest_generate_tests(metafunc):


class TestTypeHints:
def test_check_get_function_type_hints(self, class_info: Tuple[str, Type]):
def test_check_get_function_type_hints(self, class_info: Tuple[str, Type]) -> None:
"""Ensure classes derived from GetMixin have defined a 'get()' method with
correct type-hints.
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/meta/test_mro.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Wrongv4Object(RESTObject, Mixin):
import gitlab.v4.objects


def test_show_issue():
def test_show_issue() -> None:
"""Test case to demonstrate the TypeError that occurs"""

class RESTObject(object):
Expand All @@ -61,7 +61,7 @@ class Mixin(RESTObject):

with pytest.raises(TypeError) as exc_info:
# Wrong ordering here
class Wrongv4Object(RESTObject, Mixin):
class Wrongv4Object(RESTObject, Mixin): # type: ignore
...

# The error message in the exception should be:
Expand All @@ -76,7 +76,7 @@ class Correctv4Object(Mixin, RESTObject):
...


def test_mros():
def test_mros() -> None:
"""Ensure objects defined in gitlab.v4.objects have REST* as last item in
class definition.
Expand Down

Back | FazBrowse Home | New Git URL