Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: locating test folder path bug #83

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/test_internals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
import pandas as pd
from worldfinder._internals import load_data
import os
from pathlib import Path


def test_load_data_functionality():
Expand All @@ -13,7 +15,12 @@ def test_load_data_functionality():
[7, 8, 9]],
columns=['x', 'y', 'z']
)
result = load_data("../../tests", "dummy_csv.csv")

repo_root = Path(__file__).resolve().parent.parent # obtain absolute path to root of repo
test_data_path = repo_root / "tests" # Append path to the test folder
dir_path = str(test_data_path)

result = load_data(dir_path, "dummy_csv.csv")
pd.testing.assert_frame_equal(result, expected_df)


Expand Down