Skip to content

Commit c7709bf

Browse files
committed
test(event-handler): Use pathlib
1 parent ce80a90 commit c7709bf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/functional/event_handler/test_appsync.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import json
3-
import os
43
import sys
4+
from pathlib import Path
55

66
import pytest
77

@@ -11,9 +11,8 @@
1111

1212

1313
def load_event(file_name: str) -> dict:
14-
full_file_name = os.path.dirname(os.path.realpath(__file__)) + "/../../events/" + file_name
15-
with open(full_file_name) as fp:
16-
return json.load(fp)
14+
path = Path(str(Path(__file__).parent.parent.parent) + "/events/" + file_name)
15+
return json.loads(path.read_text())
1716

1817

1918
def test_direct_resolver():

0 commit comments

Comments
 (0)