Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Fix our usage of pytest ExceptionInfo. #1225

Merged
merged 1 commit into from Jul 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions bluesky/tests/test_new_examples.py
Expand Up @@ -667,18 +667,18 @@ def test_per_step(RE, hw):
# that the problem is with 'per_step':

# You can't usage one_1d_step signature with more than one motor.
with pytest.raises(TypeError) as exc:
with pytest.raises(TypeError) as excinfo:
RE(scan([hw.det],
hw.motor, -1, 1,
hw.motor2, -1, 1,
3,
per_step=one_1d_step))
assert "Signature of per_step assumes 1D trajectory" in str(exc)
assert excinfo.match("Signature of per_step assumes 1D trajectory")

# The signature must be either like one_1d_step or one_nd_step:
def bad_sig(detectors, mtr, step):
...

with pytest.raises(TypeError) as exc:
with pytest.raises(TypeError) as excinfo:
RE(scan([hw.det], hw.motor, -1, 1, 3, per_step=bad_sig))
assert "per_step must be a callable with the signature" in str(exc)
assert excinfo.match("per_step must be a callable with the signature")