title: How do I configure PyCharm to run py.test tests?
body: <p>I want to start writing unit tests for my Python code, and the <a href="http://pytest.org/" rel="noreferrer">py.test</a> framework sounds like a better bet than Python's bundled <a href="http://docs.python.org/library/unittest.html" rel="noreferrer">unittest</a>. So I added a "tests" directory to my project, and added <a href="http://doc.pytest.org/en/latest/getting-started.html#our-first-test-run" rel="noreferrer">test_sample.py</a> to it. Now I want to configure PyCharm to run all the tests in my "tests" directory.</p>
  
  <p>PyCharm allegedly <a href="http://www.jetbrains.com/pycharm/webhelp/testing-support.html" rel="noreferrer">supports py.test</a> in its test runner. You're supposed to be able to <a href="http://www.jetbrains.com/pycharm/webhelp/creating-run-debug-configuration-for-tests.html" rel="noreferrer">create a run/debug configuration</a> to run your tests, and PyCharm allegedly has a <a href="http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-py-test.html" rel="noreferrer">"create configuration" dialog box specifically for py.test</a>. But that's the complete extent of their documentation on the subject, and I can't find this alleged dialog box anywhere.</p>
  
  <p>If I right-click the directory in the Project tool window, I'm <a href="http://www.jetbrains.com/pycharm/webhelp/creating-run-debug-configuration-for-tests.html" rel="noreferrer">supposed</a> to see a "Create &lt;name&gt;" menu item, but the only menu item starting with "Create" is "Create Run Configuration". Okay, maybe the documentation is just wrong, and "Create Run Configuration" does sound promising. Unfortunately, the only two items in its submenu are "Unittests in C:\mypath..." and "Doctests in C:\mypath...", neither of which applies -- I'm using neither unittest nor doctest. There is no menu item for py.test.</p>
  
  <p>If I open my test_sample.py and right-click in the editor window, I do get the promised "Create &lt;name&gt;" menu items: there's "Create 'Unittests in test_sa...'...", followed by "Run 'Unittests in test_sa...'" and "Debug 'Unittests in test_sa...'". So again, it's all specific to the unittest framework; nothing for py.test.</p>
  
  <p>If I do try the menu items that say "unittest", I get a dialog box with options for "Name", "Type", a "Tests" group box with "Folder" and "Pattern" and "Script" and "Class" and "Function", etc. This sounds exactly like what's documented as the dialog to add a <a href="http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-python-unit-test.html" rel="noreferrer">configuration for Python Unit Test</a>, and not like the "Name" and "Test to run" and "Keywords" options that are supposed to show up in the <a href="http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-py-test.html" rel="noreferrer">configuration for py.test</a> dialog. There's nothing inside the dialog to switch which test framework I'm adding.</p>
  
  <p>I'm using PyCharm 1.5.2 on Windows with Python 3.1.3 and pytest 2.0.3. I can successfully run <code>py.test</code> on my tests from the command line, so it's not something simple like pytest not being installed properly.</p>
  
  <p>How do I configure PyCharm to run my py.test tests?</p>