Pycharm Pytest Vagrant pathmappings

How do I correctly setup this combination of tools? I've setup remote python from my Vagrant as a Project Interpreter with the correct path mappings. 

But everytime I run a test (pytest) it says file not found and shows my local file path not the vagrant file path.

Then I have to manually configure the PyTest Configuration for that 1 single test. After I setup path mappings there it works for that 1 file. When I now move to another file the configuration won't be used since it's only good for that 1 test file.

How do I configure pycharm in a way that I can run single tests/test files without setting up the configuration every time? The only issue with the configuration is always the path mappings, the rest of the defaults are fine (Remote Interpreter etc.)


So basically how do I configure the defaults for a new pytest configuration? Since it always creates a new one if I chose to run a single test via pycharm.

1 comment

Alright finally figured this one out:


At the bottom of all the Run configs is "Templates" there the path mappings can be setup.



Please sign in to leave a comment.