0

I have the current directory structure:

- api
  |
   - app.py
  |
   - tests
     |
      - test_app.py

What is the correct way to import app.py into test_app.py?

mlan
  • 119
  • 1
  • 9
  • 1
    Does this answer your question? [Importing modules from parent folder](https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder) – Olvin Roght Aug 10 '21 at 09:39
  • 1
    Is it possible for you to change your directory structure? You can check [here](https://docs.python-guide.org/writing/structure/) to see what is the desired project structure. – alparslan mimaroğlu Aug 10 '21 at 12:07
  • 1
    That's an interesting article @alparslanmimaroğlu. I managed to solve thanks to @OlvinRoght 's link with ```import sys``` and ```sys.path.append('..')``` – mlan Aug 10 '21 at 13:33

0 Answers0