Skip to main content
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.2 (2020-08-08)

Fixed

  • Updated for recent pytest changes. (#13)

0.2.1 (2020-05-10)

Fixed

  • Updated to use more recent pytest features. (#11, #12)

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+.

Release files for pytest-cram 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-cram 0.2.2
File Size Uploaded
pytest-cram-0.2.2.tar.gz 9.6 kB Details

Release files / pytest-cram-0.2.2.tar.gz

Download URL pytest-cram-0.2.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
00e358dff2836239cab47d846656d3029035a5ebb60c0cb188d16c9d6bf50510
BLAKE2b-256 checksum
How to use checksums
cd18100d6bc4e8416daf9ae8ba8877540eecc9ebe9e1cd7ee2f2f510ed1366de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2.2 This release

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page