Archived
This project has been archived by its maintainers, and is no longer receiving any updates.
I really missed assertRaisesRegexp in unittest module from pytest, so I wrote this simple plugin.
Usage
# some_module.py
class ExpectedException(Exception):
pass
def function_to_test():
raise ExpectedException('error message: 1560')
# test_some_module.py
from pytest import raises_regexp
from some_module import function_to_test, ExpectedException
def test_something_to_test():
with raises_regexp(ExpectedException, r".* 1560"):
function_to_test()
Installation
$ pip install pytest-raisesregexp
It installs as a pytest entry point, so you can:
from pytest import raises_regexp
LICENSE
MIT license Copyright (c) 2013-2015 Kiss György
Metadata
Release files for pytest-raisesregexp 2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-raisesregexp-2.1.tar.gz | 2.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_raisesregexp-2.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 7.1 kB
Release files / pytest-raisesregexp-2.1.tar.gz
| Download URL | pytest-raisesregexp-2.1.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b54372494fc1f11388b1b9348aeb36b69609699eb8f46e0e010afc733d78236a
|
|
BLAKE2b-256 checksum How to use checksums |
7a6d983b6c6ba2e06b39d987711c7435f9759c466cdb2625440595663d7dfa63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_raisesregexp-2.1-py2-none-any.whl
| Download URL | pytest_raisesregexp-2.1-py2-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
76ca176a3044ba70292351dfdb65ab0558fac9b0f2de71d3a4048593fd6c7db9
|
|
BLAKE2b-256 checksum How to use checksums |
688b7e721f57645665d5fc652172d83434a62af30ddb06eb41a34f8ec595d8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |