Skip to content

Commit 7a130eb

Browse files
committed
Adjust for moved test code
1 parent 906b271 commit 7a130eb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tools/names.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def check_old():
2222
f":!{n}"
2323
for n in (
2424
"tools/renames.json",
25-
"apsw/tests.py",
25+
"apsw/tests/__main__.py",
2626
"apsw/__init__.pyi",
2727
"Makefile",
2828
"MANIFEST.in",
@@ -64,7 +64,7 @@ def get_link(klass: str, name: str) -> str:
6464

6565

6666
def run_tests():
67-
test_file_name = pathlib.Path("apsw/tests.py")
67+
test_file_name = pathlib.Path("apsw/tests/__main__.py")
6868
source = test_file_name.read_text()
6969

7070
subs = {}
@@ -80,10 +80,16 @@ def repl(mo):
8080

8181
old_source = re.sub("\\b(" + "|".join(subs.keys()) + ")\\b", repl, source)
8282

83+
for sub, repl in (
84+
("from .ftstests import *", "from apsw.tests.ftstests import *"),
85+
("from .sessiontests import *", "from apsw.tests.sessiontests import *"),
86+
):
87+
old_source = old_source.replace(sub, repl)
88+
8389
module = types.ModuleType("tests")
8490
vars(module)["__file__"] = str(test_file_name)
8591

86-
exec(compile(old_source, "apsw/tests.py", "exec"), vars(module))
92+
exec(compile(old_source, "apsw/tests/__main__.py", "exec"), vars(module))
8793

8894
module.setup()
8995

0 commit comments

Comments
 (0)