diff --git a/Makefile b/Makefile index 2d0924840..623fbb6ce 100644 --- a/Makefile +++ b/Makefile @@ -98,8 +98,8 @@ test-json: SQLITE_EXEC=$(SQLITE_EXEC) ./testing/json.test .PHONY: test-json -test-memory: - SQLITE_EXEC=$(SQLITE_EXEC) ./testing/cli_tests/memory.py +test-memory: limbo uv-sync + SQLITE_EXEC=$(SQLITE_EXEC) uv run --project limbo_test test-memory .PHONY: test-memory test-write: limbo uv-sync diff --git a/testing/cli_tests/memory.py b/testing/cli_tests/memory.py index da98bcc1d..a329ba027 100755 --- a/testing/cli_tests/memory.py +++ b/testing/cli_tests/memory.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os -from test_limbo_cli import TestLimboShell +from cli_tests.test_limbo_cli import TestLimboShell +from cli_tests import console sqlite_flags = os.getenv("SQLITE_FLAGS", "-q").split(" ") @@ -96,15 +97,13 @@ def main(): tests = memory_tests() # TODO see how to parallelize this loop with different subprocesses for test in tests: - limbo = TestLimboShell() try: - stub_memory_test(limbo, **test) + with TestLimboShell("") as limbo: + stub_memory_test(limbo, **test) except Exception as e: - print(f"Test FAILED: {e}") - limbo.quit() + console.error(f"Test FAILED: {e}") exit(1) - limbo.quit() # remove this line when `with` statement is supported for TestLimboShell - print("All tests passed successfully.") + console.info("All tests passed successfully.") if __name__ == "__main__": diff --git a/testing/pyproject.toml b/testing/pyproject.toml index d4e257361..58292dd91 100644 --- a/testing/pyproject.toml +++ b/testing/pyproject.toml @@ -14,6 +14,7 @@ test-write = "cli_tests.write:main" test-shell = "cli_tests.cli_test_cases:main" test-extensions = "cli_tests.extensions:main" test-update = "cli_tests.update:main" +test-memory = "cli_tests.memory:main" [tool.uv] package = true