Skip to content

Commit aefc119

Browse files
committed
fix(gh-actions): pytest test path
1 parent 0ad5512 commit aefc119

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

.github/workflows/code-check.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,4 @@ jobs:
3434
run: python -m mypy src
3535

3636
- name: 👷‍ Run Tests
37-
run: pytest --cov-report html
38-
39-
- name: 🚮 Remove test environment
40-
run: |
41-
deactivate
42-
rm -rf testenv
37+
run: pytest

tests/test_users_db.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import json
33
import tempfile
4-
from os.path import abspath, dirname, join
54
from typing import Generator
65

76
import pytest
@@ -23,7 +22,7 @@
2322
postgresql_proc = factories.postgresql_proc(port=None, unixsocketdir=socket_dir.name)
2423
postgresql_mocked = factories.postgresql(
2524
"postgresql_proc",
26-
load=[join(dirname(dirname(abspath(__file__))), "database/init.sql")],
25+
load=["database/init.sql"],
2726
)
2827

2928
EMAIL_LIST = [

tests/test_xml_json.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
import os
44
from json import JSONDecodeError
5-
from os.path import abspath, dirname, join
65
from typing import List, Tuple
76

87
import pytest
@@ -14,26 +13,22 @@
1413

1514
def json_xml_valid_case_files() -> List[Tuple[str, ...]]:
1615
case_files_array: List[Tuple[str, ...]] = []
17-
for file in glob.glob(join(dirname(abspath(__file__)), "data/xml_json/*")):
16+
for file in glob.glob("tests/data/xml_json/*"):
1817
case = glob.glob(os.path.join(file, "test.*"))
1918
case_files_array.append(tuple(case))
2019
return case_files_array
2120

2221

2322
def json_invalid_format_files() -> List[str]:
2423
case_files_array: List[str] = []
25-
for case in glob.glob(
26-
join(dirname(abspath(__file__)), "data/json_invalid/*/test.json")
27-
):
24+
for case in glob.glob("tests/data/json_invalid/*/test.json"):
2825
case_files_array.append(case)
2926
return case_files_array
3027

3128

3229
def xml_invalid_format_files() -> List[str]:
3330
case_files_array: List[str] = []
34-
for case in glob.glob(
35-
join(dirname(abspath(__file__)), "data/xml_invalid/*/test.xml")
36-
):
31+
for case in glob.glob("tests/data/xml_invalid/*/test.xml"):
3732
case_files_array.append(case)
3833
return case_files_array
3934

0 commit comments

Comments
 (0)