path issues when running unit tests

I'm running into trouble when running tests from a directory which is under the project directory.

I have the following folder structure:


so t=he test I'm trying to run is /project/lib2/tests/,
and it needs to import the module /project/lib2/

I've tried to set the interpreter working directory by going to:
Edit configurations –> Unittests in test_source1 –>Interperter –> Working directory, and setting it to: /project/lib2/ and then to /project, but still I'm unable to import in

Please advise,
Comment actions Permalink
If I understand your configuration correctly, you need to mark the lib1 and lib2 directories as source roots in Settings | Project Structure.
Comment actions Permalink
Thanks Dmitry - did the trick!

Please sign in to leave a comment.