Skip to content

Commit

Permalink
use sqlite db name randomization due to conflicts on windows ci run
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Dec 19, 2022
1 parent 0b47fcf commit 9e35d97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

# Standard Library
import os.path
import random
import sqlite3
import string
import sys
import tempfile
import unittest
Expand Down Expand Up @@ -43,7 +45,9 @@ def setUp(self) -> None:
sys_info = (
f"{sys.implementation.name}_{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
)
self.db_path = os.path.join(tempfile.gettempdir(), f"test.sqlite3_{sys_info}")
suffix_source = string.ascii_letters = string.digits
suffix = "".join(random.choice(suffix_source) for _ in range(3))
self.db_path = os.path.join(tempfile.gettempdir(), f"test.sqlite3_{suffix}_{sys_info}")
self.session = None

if os.path.exists(self.db_path):
Expand Down

0 comments on commit 9e35d97

Please sign in to comment.