diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 20:28:15 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 21:08:47 +0100 |
commit | 6b892e3dcb18d0f43da6020b08fd4ba891da3670 (patch) | |
tree | e97beaaca3b5b94764f78e0fd99df0c53fd19f8b /tests/unit/objects/test_todos.py | |
parent | 70b9870f929c4db32fd2e1406db2122de9958bfd (diff) | |
download | gitlab-test/cli-coverage.tar.gz |
test(cli): improve basic CLI coveragetest/cli-coverage
Diffstat (limited to 'tests/unit/objects/test_todos.py')
-rw-r--r-- | tests/unit/objects/test_todos.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/unit/objects/test_todos.py b/tests/unit/objects/test_todos.py index 9d6b6b4..ded6cf9 100644 --- a/tests/unit/objects/test_todos.py +++ b/tests/unit/objects/test_todos.py @@ -3,20 +3,22 @@ GitLab API: https://docs.gitlab.com/ce/api/todos.html """ import json -import os import pytest import responses from gitlab.v4.objects import Todo -with open(f"{os.path.dirname(__file__)}/../data/todo.json", "r") as json_file: - todo_content = json_file.read() - json_content = json.loads(todo_content) + +@pytest.fixture() +def json_content(fixture_dir): + with open(fixture_dir / "todo.json", "r") as json_file: + todo_content = json_file.read() + return json.loads(todo_content) @pytest.fixture -def resp_todo(): +def resp_todo(json_content): with responses.RequestsMock(assert_all_requests_are_fired=False) as rsps: rsps.add( method=responses.GET, |