Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A helper for testing output of a process in tests.
Python
branch: master
Failed to load latest commit information.
what
.gitignore
.travis.yml
LICENSE
README.rst
program.py
setup.py
test.py
tox.ini

README.rst

What

https://travis-ci.org/cenkalti/what.png

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.
Something went wrong with that request. Please try again.