Skip to main content

A helper for testing process output

Project description

A helper for testing output of a process in tests.

Installing

$ pip install what

Usage

>>> from what import What
>>> w = What('echo', 'hello world')
>>> w.expect('hello')
'hello world'
>>> w.expect('unicorns', timeout=1)
>>> # ... tracback here ...
what.exceptions.EOF: End of file is reached while expecting string
Expected: unicorns
Return code: 0
Timed out: False
Last 100 lines:
======================================================================
hello world
>>> w.expect_exit(0)

Changes

  • 0.5.0: Add support for Python 3.
  • 0.4.4: Changed WhatError to inherit from AssertionError in order to be compatible with unittest.

Project details


Download files

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

Files for What, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size What-0.5.0.tar.gz (7.2 kB) File type Source Python version None Upload date Hashes View hashes

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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page