Skip to content

Commit 502e371

Browse files
committed
Implement fixture to setup temp_pulse folder on tests
1 parent a96d2f3 commit 502e371

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/conftest.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
Pytest configuration file to set up test environment.
3+
"""
4+
import pytest
5+
from pathlib import Path
6+
7+
8+
@pytest.fixture(scope="session", autouse=True)
9+
def setup_test_environment(tmp_path_factory):
10+
"""
11+
Set up the test environment before running any tests.
12+
Uses pytest's temporary directory for test isolation.
13+
"""
14+
import pulse
15+
16+
# Create a pytest temporary directory for test projects
17+
temp_dir = tmp_path_factory.mktemp("temp_pulse")
18+
19+
# Override the module-level constants
20+
pulse.TEMP_PROJECT_DIR = temp_dir
21+
pulse.TEMP_PROJECT_FILE = str(temp_dir / "tmp.pulse")
22+
23+
yield
24+
25+
# Cleanup is handled automatically by pytest

0 commit comments

Comments
 (0)