Skip to content

Commit 21de12c

Browse files
refactor(test): Move utils to test/common/
1 parent 05f1134 commit 21de12c

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

test/common/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .common import CommonTestCase, TokenStreamFlag
2+
from .snapshottest import SnapshotTestCase, SnapshotsNotFound, CantUpdateSnapshots
3+
from .utils import TestCaseUtils

test/common.py renamed to test/common/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from parser.cst.treegen import TreeGen, CstParseError
1515
from parser.lexer import Tokenizer
1616
from parser.lexer.tokens import Token, OpToken
17-
from test.snapshottest import SnapshotTestCase
18-
from test.utils import TestCaseUtils
17+
from test.common.snapshottest import SnapshotTestCase
18+
from test.common.utils import TestCaseUtils
1919

2020

2121
def _strict_boundary_kwargs():

test/utils.py renamed to test/common/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def setProperCwd(self):
6969
return
7070
self._old_cwd = os.getcwd()
7171
dirname = Path(__file__).parent
72-
os.chdir(dirname.parent)
72+
os.chdir(dirname.parent.parent)
7373
assert self.isProperCwdSet()
7474
self.addCleanup(self.resetCwd)
7575

test/test_from_fuzzer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import unittest
33
from pathlib import Path
44

5-
from parser.lexer.tokenizer import Tokenizer
65
from parser.cst.treegen import TreeGen
7-
from test.common import CommonTestCase
8-
9-
from test.utils import TestCaseUtils
6+
from parser.lexer.tokenizer import Tokenizer
7+
from test.common import CommonTestCase, TestCaseUtils
108
from util import timeout_decor, timeout_decor_async
119

1210

0 commit comments

Comments
 (0)