How to import python class file from same directory?

Solution 1:

Since you are using Python 3, which disallows these relative imports (it can lead to confusion between modules of the same name in different packages).

Use either:

from models import finding

or

import models.finding

or, probably best:

from . import finding  # The . means "from the same directory as this module"

Solution 2:

Apparently I can do: from .finding import Finding and this works.

And the answer below reflects this as well so I guess this is reasonably correct.

I've fixed up my file naming and moved my tests to a different directory and I am running smoothly now. Thanks!