Skip to content

Commit 77fd964

Browse files
authored
Merge pull request #17 from Geode-solutions/fix/type_checker
type tests since src is ok
2 parents dcff672 + fc65331 commit 77fd964

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from typing import Generator
23
import pytest
34
from opengeodeweb_microservice.database.connection import init_database, get_session
45
from opengeodeweb_microservice.database.data import Data
@@ -8,13 +9,13 @@
89

910

1011
@pytest.fixture(scope="session", autouse=True)
11-
def setup_database():
12+
def setup_database() -> Generator[None, None, None]:
1213
init_database(DB_PATH)
1314
yield
1415
_cleanup_database(DB_PATH)
1516

1617

17-
def _cleanup_database(db_path: str):
18+
def _cleanup_database(db_path: str) -> None:
1819
try:
1920
session = get_session()
2021
session.close()
@@ -29,7 +30,7 @@ def _cleanup_database(db_path: str):
2930

3031

3132
@pytest.fixture(autouse=True)
32-
def clean_database():
33+
def clean_database() -> Generator[None, None, None]:
3334
with get_session() as session:
3435
session = get_session()
3536
session.query(Data).delete()

tests/test_database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from opengeodeweb_microservice.database.data import Data
22

33

4-
def test_data_crud_operations(clean_database):
4+
def test_data_crud_operations(clean_database: None) -> None:
55
data = Data.create(
66
geode_object="test_object",
77
viewer_object="test_viewer",
@@ -22,7 +22,7 @@ def test_data_crud_operations(clean_database):
2222
assert non_existent is None
2323

2424

25-
def test_data_with_additional_files(clean_database):
25+
def test_data_with_additional_files(clean_database: None) -> None:
2626
files = ["file1.txt", "file2.txt"]
2727
data = Data.create(
2828
geode_object="test_files",

0 commit comments

Comments
 (0)