-2

I'm trying to make unit tests for my train.py file. But I can't import the train.py file. I've tried everything in comments on my screenshot. the structure is as follow:

project/
   train.py
unit_tests/
   train_test.py

[1]:

paul-shuvo
  • 1,772
  • 3
  • 31
  • 37
mtthsv
  • 1

1 Answers1

0

Can you paste your actual project structure? It could be that you need to do a relative import. As example:

from .project import train
from ..project import train
from . import train
user_na
  • 1,567
  • 13
  • 28