mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Minor pytest maintenance (#702)
* Add `pytest.ini` config file and set default options there instead of in `CMakeLists.txt` (command line arguments). * Change all output capture from `capfd` (filedescriptors) to `capsys` (Python's `sys.stdout` and `sys.stderr`). This avoids capturing low-level C errors, e.g. from the debug build of Python. * Set pytest minimum version to 3.0 to make it easier to use new features. Removed conditional use of `excinfo.match()`. * Clean up some leftover function-level `@pytest.requires_numpy`.
This commit is contained in:
committed by
Wenzel Jakob
parent
303ee29d9f
commit
d47febcb17
@@ -34,10 +34,8 @@ def test_named_arguments(msg):
|
||||
with pytest.raises(TypeError) as excinfo:
|
||||
# noinspection PyArgumentList
|
||||
kw_func2(x=5, y=10, z=12)
|
||||
if hasattr(excinfo, "match"): # (pytest <3.0 doesn't have `.match()`)
|
||||
assert excinfo.match(
|
||||
r'(?s)^kw_func2\(\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))' +
|
||||
'{3}$')
|
||||
assert excinfo.match(
|
||||
r'(?s)^kw_func2\(\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))' + '{3}$')
|
||||
|
||||
assert kw_func4() == "{13 17}"
|
||||
assert kw_func4(myList=[1, 2, 3]) == "{1 2 3}"
|
||||
|
||||
Reference in New Issue
Block a user