Skip to content

Commit

Permalink
WIP: fix: use absolute path to find pyproject.toml in test_toml.py
Browse files Browse the repository at this point in the history
target to fix: issue #256
  • Loading branch information
SylviaDu99 committed Sep 12, 2024
1 parent 09921a6 commit 43e2deb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/core/test_toml.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import os
from pathlib import Path
import tomli

import pytest
import tomli


@pytest.fixture(scope="module")
def toml_data():
file_path = Path("/policyengine-core/pyproject.toml")
# get the path of current file and find pyproject.toml relatively
file_path = (
Path(os.path.abspath(os.path.dirname(__file__))).parents[1]
/ "pyproject.toml"
)
if not file_path.exists():
pytest.fail(f"pyproject.toml not found in the current directory.")
with open(file_path, "rb") as f:
Expand Down

0 comments on commit 43e2deb

Please sign in to comment.