Skip to content

Commit

Permalink
Patch platformdirs where it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvgoncalves committed Jun 13, 2024
1 parent 14f216c commit c426a1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ def fixtures_dir():

@pytest.fixture(autouse=True)
def temporary_logs_dir(monkeypatch, tmp_path):
def temp_user_log_dir(*args, **kwargs):
return tmp_path

monkeypatch.setattr(platformdirs, "user_log_dir", temp_user_log_dir)
monkeypatch.setattr("bw_simapro_csv.main.user_log_dir", lambda *args, **kwargs: tmp_path)
yield tmp_path
6 changes: 6 additions & 0 deletions tests/test_header.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from datetime import datetime
from pathlib import Path

from bw_simapro_csv import SimaProCSV
from bw_simapro_csv.header import SimaProCSVType


def test_log_file_patching(fixtures_dir: Path, temporary_logs_dir: Path):
obj = SimaProCSV(fixtures_dir / "allocation.csv")
assert str(temporary_logs_dir) in str(obj.logs_dir)


def test_basic_header_extraction(fixtures_dir):
obj = SimaProCSV(fixtures_dir / "allocation.csv")
assert obj.header == {
Expand Down

0 comments on commit c426a1b

Please sign in to comment.