0

One

I have this python application structure in Visual Studio 2017. I created a tests folder using the Solution explorer and there's a test.py file in it. I want to use the test module which is stored in tests directory. But when I try to use import tests.test it says test not defined. I have just started learning python. I looked up to this but I dont understand why isnt it working. Am I doing something wrong? I looked it up here

martineau
  • 119,623
  • 25
  • 170
  • 301
DragneelFPS
  • 453
  • 4
  • 12

1 Answers1

4

You are trying to import from from package. Each package must have an __init__.py file. You just have to add a blank file __init__.py to your tests folder and then it should be fine.

Adrijaned
  • 430
  • 6
  • 13