Skip to content

Commit

Permalink
Merge pull request #682 from gschwind/pr-mktmpdir-for-test-assync
Browse files Browse the repository at this point in the history
Create temporary directory for storing test_assync database
  • Loading branch information
cehbrecht authored Oct 30, 2023
2 parents 647d8cf + 789025a commit a704cd3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_assync.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from .processes import Sleep
from owslib.wps import WPSExecution
from pathlib import Path
from tempfile import TemporaryDirectory
from pywps import dblog

VERSION = "1.0.0"

Expand All @@ -20,12 +22,19 @@

class ExecuteTest(unittest.TestCase):
def setUp(self) -> None:

# Create temporary directory to create test database.
self.tmpdir = TemporaryDirectory()

# Running processes using the MultiProcessing scheduler and a file-based database
configuration.CONFIG.set('processing', 'mode', 'distributed')
configuration.CONFIG.set("logging", "database", "sqlite:////tmp/test-pywps-logs.sqlite3")

configuration.CONFIG.set("logging", "database", f"sqlite:///{self.tmpdir.name}/test-pywps-logs.sqlite3")

def tearDown(self) -> None:
# Cleanup temporary database
configuration.load_configuration()
self.tmpdir.cleanup()

def test_async(self):
client = client_for(Service(processes=[Sleep()]))
Expand Down

0 comments on commit a704cd3

Please sign in to comment.