<commit_before>===============================
pytest-pycharm
===============================

.. image:: https://badge.fury.io/py/pytest-pycharm.png
    :target: http://badge.fury.io/py/pytest-pycharm

Plugin for py.test to enter PyCharm debugger on uncaught exceptions

* Free software: BSD license

Features
--------

* Uncaught exceptions in py.test test cases will trigger the PyCharm debugger


Installation
------------

You can install the plugin by running

    pip install pytest-pycharm

Alternately check out the source code and run

    python setup.py install


Usage
-----

In pycharm choose ``run/edit configurations``. On the upper left corner, click
on the + and choose ``python``. Call it pycharm or anything you like.
As a script, choose the pytest executable (find its path using 
``which pytest``). Add script parameters if you use them.

Be sure to have the right python interpreter selected. Choose the working 
directory. Apply changes and close the window.

You can now select ``run/debug pytest`` and the debugger will stop on uncaught
exceptions.

As an example, on the command line I use the following

 .. code:: bash
 
    cd ~/project_folder
    source virtualenv/bin/activate
    # project_folder contains setup.py, the package folder and tests folder
    pytest --cov-report html --cov=my_package tests

As a consequence I put

- ``~/project_folder/virtualenv/bin/pytest`` for the script
- ``--cov-report html --cov=my_package tests`` for the parameters
- the python interpreter from the project virtual environment
- ``~/project_folder/`` for the working directory
<commit_msg>Fix #8, add simplified usage<commit_after>===============================
pytest-pycharm
===============================

.. image:: https://badge.fury.io/py/pytest-pycharm.png
    :target: http://badge.fury.io/py/pytest-pycharm

Plugin for ``pytest`` to enter PyCharm debugger on uncaught exceptions

* Free software: BSD license

Features
--------

* Uncaught exceptions in ``pytest`` test cases will trigger the PyCharm
  debugger


Installation
------------

You can install the plugin by running

    pip install pytest-pycharm

Alternately check out the source code and run

    python setup.py install


Usage
-----

You are ready to go right after the plugin installation. Execute any test in
PyCharm by right-clicking on a test and selecting *Debug pytest in ...*. The
debugger will pause on a false assertion (see `test example`_).

The plugin also works with custom ``pytest`` Run Configurations:
*Run | Edit Configurations | Add New Configuration | Python tests | pytest*.

**Note:** make sure the Run Configuration uses the correct interpreter with
``pytest-pycharm`` installed.

.. _test example: test_dummy.py

{'fraction_non_alphanumeric': 0.1351845085860431, 'fraction_numerical': 0.00036536353671903543, 'mean_word_length': 3.770034843205575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3451872', 'n_tokens_mistral': 766, 'n_tokens_neox': 758, 'n_words': 320}