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.
Metadata
Release files for What 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| What-0.5.0.tar.gz | 7.2 kB | Without provenance | Details |
Release files / What-0.5.0.tar.gz
| Download URL | What-0.5.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6a3fa57bdbd7dd93b3e6c6961aeffa10edcfe7997adc6c3cabab7a16660b45d
|
|
BLAKE2b-256 checksum How to use checksums |
16b9140483972e4a93104a9041a7a0efe956f2766105338aec6f4f01530fe717
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for What 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.