mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-30 09:42:21 +01:00
test: check database ownership against the private temp namespace
This commit is contained in:
@@ -85,6 +85,7 @@ def test_actual_tests_restore_process_state_and_ignore_inherited_database(tmp_pa
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import pytest
|
import pytest
|
||||||
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from sqlalchemy.engine import make_url
|
from sqlalchemy.engine import make_url
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ def test_actual_tests_restore_process_state_and_ignore_inherited_database(tmp_pa
|
|||||||
self.default_path = Path(make_url(self.initial[0]).database)
|
self.default_path = Path(make_url(self.initial[0]).database)
|
||||||
assert self.default_path.is_file()
|
assert self.default_path.is_file()
|
||||||
assert self.default_path.name == "collection.db"
|
assert self.default_path.name == "collection.db"
|
||||||
assert self.default_path.parent == Path(os.environ["ODYSSEUS_DATA_DIR"]).parent
|
assert self.default_path.parent == Path(tempfile.gettempdir()).parent
|
||||||
|
|
||||||
def pytest_collection_finish(self):
|
def pytest_collection_finish(self):
|
||||||
assert snapshot() == self.initial, "collection changed database bindings"
|
assert snapshot() == self.initial, "collection changed database bindings"
|
||||||
|
|||||||
Reference in New Issue
Block a user