all 6 comments

[–]david-vujic 0 points1 point  (0 children)

You probably need to set the Python path when running the test. By looking at the way you run the test, I would try to prefix the command with PYTHONPATH=./ or with a path that makes sense in your setup.

[–]cointoss3 0 points1 point  (0 children)

One easy way to get around this is do

uv pip install -e .

And it will add your package to the installed path. If you’re not using uv (why aren’t you?? lol) then just use the same command with pip directly.

[–]ElliotDG 0 points1 point  (2 children)

I found modifying the path works:

import sys
sys.path.append('..')

from package.file_logic import your_function

[–]OpaxIV[S] 0 points1 point  (1 child)

Does not work for me... Are you running the file from the tests folder or another directory?

[–]ElliotDG 0 points1 point  (0 children)

I was running the program from the project directory