Skip to content

Commit c209dc0

Browse files
Add a path argument to get_tests for functional tests
1 parent ed55e8f commit c209dc0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_functional.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import csv
2626
import os
2727
import sys
28-
from typing import Union
28+
from pathlib import Path
29+
from typing import List, Union
2930

3031
import pytest
3132
from _pytest.config import Config
@@ -64,8 +65,7 @@ def _check_output_text(self, _, expected_output, actual_output):
6465
writer.writerow(line.to_csv())
6566

6667

67-
def get_tests():
68-
input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional")
68+
def get_tests(input_dir: Union[Path, str]) -> List[FunctionalTestFile]:
6969
suite = []
7070
for dirpath, _, filenames in os.walk(input_dir):
7171
if dirpath.endswith("__pycache__"):
@@ -85,7 +85,9 @@ def get_tests():
8585
return suite
8686

8787

88-
TESTS = get_tests()
88+
TESTS = get_tests(
89+
os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional")
90+
)
8991
TESTS_NAMES = [t.base for t in TESTS]
9092
TEST_WITH_EXPECTED_DEPRECATION = [
9193
"future_unicode_literals",

0 commit comments

Comments
 (0)