Skip to main content

Run cram tests with pytest.

Project description

Latest PyPI version Number of PyPI downloads Travis-CI build status AppVeyor build status Test coverage

pytest-cram: Run cram tests with py.test

cram tests command line applications. pytest tests Python applications. pytest-cram tests Python command line applications by letting you write your Python API tests with pytest, and your command line tests in cram. Best of both worlds!

Installation

To install and use pytest-cram, do

pip install pytest-cram

pytest-cram works on Python 2.7 and 3.3+ and with cram versions 0.7 and up.

Usage

Once installed, all .t files will be collected and run with cram, so installation should be all that is needed.

If you wish to disable cram tests for an invocation of pytest, do

py.test --nocram

To override the shell used by cram, do

py.test --shell="C:\git\bash.exe"

or set the CRAMSHELL environment variable

CRAMSHELL=/bin/bash py.test

If you wish to disable specific cram tests, list them in a .ini file

[pytest]
cramignore = file1.t
    pattern*.t

Release History

0.2.0 (2018-02-06)

Fixed

  • Fixed tests to work with pytest>=3.3. Pytest added progress indicators to test output in version 3.3, which the tests were not expecting.

0.1.1 (2016-03-07)

Added

  • Added the --shell command line option and now checks the CRAMSHELL environment variable to override the default /bin/sh shell. (#3)

    Thanks to Florian Rathgeber for the contribution!

Changed

  • Depend explicitly on cram>=0.7. If you would like support for earlier versions of cram, please file an issue.

0.1.0 (2016-02-28)

Initial release of pytest-cram! Supports Python 2.7+ and 3.3+.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest-cram-0.2.0.zip (18.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page