Skip to content

Commit a947cfb

Browse files
committed
tests/github_sync: use __file__ to search for test data
This allows to run the test from an arbitrary working directory. Signed-off-by: Ihor Solodrai <[email protected]>
1 parent 805aa18 commit a947cfb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_github_sync.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# pyre-unsafe
88

99
import copy
10+
import os
1011
import unittest
1112
from dataclasses import dataclass
1213
from typing import Any, Dict, Optional
@@ -330,9 +331,11 @@ async def test_sync_patches_pr_summary_success(self, m: aioresponses) -> None:
330331
For patchwork mocking, it uses real response examples stored at tests/data/
331332
"""
332333

333-
test_data = load_test_data(
334-
"tests/data/test_github_sync.test_sync_patches_pr_summary_success"
334+
data_path = os.path.join(
335+
os.path.dirname(__file__),
336+
"data/test_github_sync.test_sync_patches_pr_summary_success",
335337
)
338+
test_data = load_test_data(data_path)
336339
init_pw_responses(m, test_data)
337340

338341
# Set up mocks and test data

0 commit comments

Comments
 (0)