Skip to content

Commit

Permalink
Fix Relative Imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RyEggGit committed Dec 28, 2023
1 parent 550ba9c commit eeacec3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ jobs:

- name: Run PyTest
run: pytest
working-directory: src
7 changes: 7 additions & 0 deletions src/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys
from pathlib import Path

# Add root directory to path to allow imports from src
# this just makes it so that we don't have to cd into src to run tests
root_dir = str(Path(__file__).resolve().parents[1])
sys.path.append(root_dir)

0 comments on commit eeacec3

Please sign in to comment.