Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b2f6bc

Browse files
nejchJohnVillalovos
authored andcommitted
chore: add basic typing to test root
1 parent8f74a33 commit0b2f6bc

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

‎.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ repos:
3535
-id:mypy
3636
args:[]
3737
additional_dependencies:
38+
-pytest==7.1.3
3839
-types-PyYAML==6.0.12
3940
-types-requests==2.28.11.2
4041
-types-setuptools==64.0.1

‎pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ warn_unused_ignores = true
2929
module = [
3030
"docs.*",
3131
"docs.ext.*",
32-
"tests.*",
3332
"tests.functional.*",
3433
"tests.functional.api.*",
34+
"tests.meta.*",
3535
"tests.unit.*",
3636
"tests.smoke.*"
3737
]

‎tests/conftest.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
importpathlib
2+
3+
import_pytest.config
14
importpytest
25

36
importgitlab
47

58

69
@pytest.fixture(scope="session")
7-
deftest_dir(pytestconfig):
8-
returnpytestconfig.rootdir/"tests"
10+
deftest_dir(pytestconfig:_pytest.config.Config)->pathlib.Path:
11+
returnpytestconfig.rootdir/"tests"# type: ignore
912

1013

1114
@pytest.fixture(autouse=True)
12-
defmock_clean_config(monkeypatch):
15+
defmock_clean_config(monkeypatch:pytest.MonkeyPatch)->None:
1316
"""Ensures user-defined environment variables do not interfere with tests."""
1417
monkeypatch.delenv("PYTHON_GITLAB_CFG",raising=False)
1518
monkeypatch.delenv("GITLAB_PRIVATE_TOKEN",raising=False)
@@ -19,19 +22,19 @@ def mock_clean_config(monkeypatch):
1922

2023

2124
@pytest.fixture(autouse=True)
22-
defdefault_files(monkeypatch):
25+
defdefault_files(monkeypatch:pytest.MonkeyPatch)->None:
2326
"""Ensures user configuration files do not interfere with tests."""
2427
monkeypatch.setattr(gitlab.config,"_DEFAULT_FILES", [])
2528

2629

2730
@pytest.fixture
28-
defvalid_gitlab_ci_yml():
31+
defvalid_gitlab_ci_yml()->str:
2932
return"""---
3033
:test_job:
3134
:script: echo 1
3235
"""
3336

3437

3538
@pytest.fixture
36-
definvalid_gitlab_ci_yml():
39+
definvalid_gitlab_ci_yml()->str:
3740
return"invalid"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp