Disable Pytest in PyCharm
<p>If I have a file beginning with &quot;test_&quot;, PyCharm tries to run this with PyTest.  I want to run it normally (as a regular Python script).  How can I do this?</p>
<p><strong>Edit</strong> See Milo's answer below.  If for some reason that does not work for you, as A. Romeau pointed out, there is a way to do this on a per-file basis:</p>
<ol>
<li>For a given test file that you want to run normally:</li>
</ol>
<ul>
<li>Run the file... note that it runs under py.test or some other testing framework.</li>
<li>Click on the drop-down box on the top-right that says something like &quot;py.test in test_something.py&quot;.</li>
<li>Click &quot;Edit Configurations&quot;.  This will open a window with &quot;Python&quot; and &quot;Python tests&quot; as options on the left.  You'll notice you're in the &quot;Python tests&quot; section.</li>
<li>Copy the file path in the &quot;Target:&quot; field.</li>
<li>Click the red &quot;-&quot; in the top left, which will remove that test configuration.</li>
<li>Now, click the green &quot;+&quot;, select &quot;Python&quot;, and paste the file path you copied in the &quot;Script:&quot; field.</li>
<li>Press &quot;OK&quot;.  Your test file will now run as an ordinary script.</li>
</ul>
<ol start="2">
<li>Edit your setup.cfg file in pytest (with some option that I don't know right now) so that it doesn't &quot;discover&quot; your test (I have not tried this).</li>
</ol>
<p>Neither solution is good.  1 is inconvenient because you need to go through a big mutli-click and process for each file you might want to run like this.  2 is inconvenient because it interferes with you running pytest normally, from console.</p>
<p>JetBrains: Please for the love of God just add an option to disable automatic unittesting.  It is very annoying because the output of pytest/UnitTest is not nearly as helpful as the output of the regular interpreter when trying to track down bugs in tests (no links to the failing line, can't easily run given function alone, etc).</p>
<p>A PyCharm &quot;issue&quot; has been opened <a href="https://youtrack.jetbrains.com/issue/PY-19687" rel="noreferrer">here</a>.</p>