So here's my file structure
root
project
|-- src
|-- example.py
|-- test
|-- test_example.py
I know adding an __init__.py to each dir would help but I don't know what to put inside those
project
|-- src
|-- __init__.py
|-- example.py
|-- test
|-- __init__.py
|-- test_example.py
and for the sake of completeness, here are the contents of the files
def return_one():
return 1
test_example.py
from src.example import return_one
import unittest
class TestExample(unittest.TestCase):
def test_return_one(self):
self.assertEqual(1, return_one())
I've also tried from from ..src.example import return_one