Skip to main content

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

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-pycharm-0.5.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distributions

pytest_pycharm-0.5.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

pytest_pycharm-0.5.0-py2-none-any.whl (4.6 kB view details)

Uploaded Python 2

File details

Details for the file pytest-pycharm-0.5.0.tar.gz.

File metadata

File hashes

Hashes for pytest-pycharm-0.5.0.tar.gz
Algorithm Hash digest
SHA256 86f24ed21cdeb483be64f4e8b89d87ed8393de63a60665f9f3915175c64247f2
MD5 7c5f2d488afe0c1e915085c60e1ae829
BLAKE2b-256 49b6d054cc4cb78017b630f02fe88edbc0670769394c4912e67001994da406d8

See more details on using hashes here.

File details

Details for the file pytest_pycharm-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_pycharm-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e51c032f5c5953e65aac4b486dd7d7abe4322fc7e951328f229630b3e6bd09f
MD5 ad0003488aad8a5285153ae7f25f4850
BLAKE2b-256 5ffc4e30fca8f1c896a475ec700f0426512804bc9147cc458d6b1048b3d4546f

See more details on using hashes here.

File details

Details for the file pytest_pycharm-0.5.0-py2-none-any.whl.

File metadata

File hashes

Hashes for pytest_pycharm-0.5.0-py2-none-any.whl
Algorithm Hash digest
SHA256 78839dd69958548718ad52fe17cad7834bb76362b025acbb08e8ca6edad6793a
MD5 b53c3e726f4027b6f07df52eeae8606d
BLAKE2b-256 982d9c184333dcab79763a0de2a07f5c0ea530fb5fbab8d1c0bceec50efb5559

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page