File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ strict = true
12
12
module = [
13
13
" docs.*" ,
14
14
" docs.ext.*" ,
15
- " tests.functional.*" ,
16
15
" tests.functional.api.*" ,
17
16
" tests.unit.*" ,
18
17
]
19
18
ignore_errors = true
20
19
21
20
[[tool .mypy .overrides ]]
22
21
module = [
22
+ " tests.functional.*" ,
23
23
" tests.meta.*" ,
24
24
" tests.smoke.*" ,
25
25
]
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ isort==5.10.1
6
6
mypy==0.981
7
7
pylint==2.15.3
8
8
pytest==7.1.3
9
+ responses==0.21.0
9
10
types-PyYAML==6.0.12
10
11
types-requests==2.28.11.2
11
12
types-setuptools==65.5.0.1
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def gitlab_version(gl) -> GitlabVersion:
37
37
38
38
39
39
@pytest .fixture (scope = "session" )
40
- def fixture_dir (test_dir ) -> pathlib .Path :
40
+ def fixture_dir (test_dir : pathlib . Path ) -> pathlib .Path :
41
41
return test_dir / "functional" / "fixtures"
42
42
43
43
@@ -56,7 +56,8 @@ def gitlab_container_name() -> str:
56
56
57
57
@pytest .fixture (scope = "session" )
58
58
def gitlab_docker_port (docker_services , gitlab_service_name : str ) -> int :
59
- return docker_services .port_for (service = gitlab_service_name , container_port = 80 )
59
+ port : int = docker_services .port_for (gitlab_service_name , container_port = 80 )
60
+ return port
60
61
61
62
62
63
@pytest .fixture (scope = "session" )
@@ -114,7 +115,7 @@ def reset_gitlab(gl: gitlab.Gitlab) -> None:
114
115
helpers .safe_delete (user , hard_delete = True )
115
116
116
117
117
- def set_token (container , fixture_dir ) :
118
+ def set_token (container : str , fixture_dir : pathlib . Path ) -> str :
118
119
logging .info ("Creating API token." )
119
120
set_token_rb = fixture_dir / "set_token.rb"
120
121
Original file line number Diff line number Diff line change 1
1
import logging
2
2
import time
3
- from typing import Optional
3
+ from typing import Optional , TYPE_CHECKING
4
4
5
5
import pytest
6
6
@@ -19,8 +19,10 @@ def get_gitlab_plan(gl: gitlab.Gitlab) -> Optional[str]:
19
19
license = gl .get_license ()
20
20
except gitlab .exceptions .GitlabLicenseError :
21
21
# Without a license we assume only Free features are available
22
- return
22
+ return None
23
23
24
+ if TYPE_CHECKING :
25
+ assert isinstance (license ["plan" ], str )
24
26
return license ["plan" ]
25
27
26
28
@@ -34,7 +36,7 @@ def safe_delete(
34
36
manager = object .manager
35
37
for index in range (MAX_ITERATIONS ):
36
38
try :
37
- object = manager .get (object .get_id ())
39
+ object = manager .get (object .get_id ()) # type: ignore[attr-defined]
38
40
except gitlab .exceptions .GitlabGetError :
39
41
return
40
42
You can’t perform that action at this time.
0 commit comments