From 7b3468ab2dbfb57f5bdee8178935098c4dc9d8c2 Mon Sep 17 00:00:00 2001 From: Laurin Schmidt Date: Tue, 12 Nov 2024 16:19:09 +0100 Subject: [PATCH] fix tests on windows (partly) --- tests/test_action.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_action.py b/tests/test_action.py index 1e229eb2..34917fef 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -2,6 +2,7 @@ import copy import multiprocessing import os +import sys import threading import time import unittest @@ -18,7 +19,18 @@ ) SECRET = str(uuid.uuid4()) -db = DAL("sqlite://storage_%s" % uuid.uuid4(), folder="/tmp/") +if sys.platform == "win32": + path = "./tmp/" +else: + path = "/tmp/" + +try: + os.mkdir(path) +except Exception: + pass +with open(path + "sql.log", "w"): + pass +db = DAL("sqlite://storage_%s" % uuid.uuid4(), folder=path) db.define_table("thing", Field("name")) session = Session(secret=SECRET) cache = Cache()