Cannot mark directory as source in PyCharm

I tried to mark the directory as the root of the test sources in PyCharm, so I do not need to manually set the destination directory for my generated test file every time. When I right-clicked my "tests" directory, I only see the following four options:

Mark the directory as: 1. Source root 2. Template folder 3. Excluded 4. Resource root

I remember how it was done in Intellij for Java, but is it impossible for PyCharm?

+7
source share
3 answers

Do the following:

  1. Mark the directory as "sources".
  2. Close PyCharm.
  3. Open the <project root>/.idea/<projectname>.iml in a text editor.
  4. Find "isTestSource =" for the respective directories and change it from "false" to "true".
  5. Open PyCharm.
+3
source

To simplify the user interface, the test source root configuration parameter is not displayed in the PyCharm user interface.

0
source

In PyCharm 2017.1.3
On the test toolbar, click change configurations , then you can set the working directory by default, this will be used by each test at the first start.

Test Toolbar

Where to set up the default PyCharm test desktop

Hope this helps!

-1
source

All Articles