qilimanjaro-tech/qililab

[BUG] `Asserts` inside `with` are not really asserting anything in qililab tests.

Closed this issue · 4 comments

Expected behavior

We should assert things during tests.

Actual behavior

Asserts inside with, never make a test fail!
Screenshot 2023-10-26 at 16 01 54

What acuatlly is happening :

The error makes you leave the with, so the assert is never actually run
(I just debugged this, and its true, you never arrive to the assert, since the erro makes you leave the with)

To be more precise, this only happens when using with pytest.raises.

If this is fixed, please close the issue.

There was only one test doing this incorrectly in the end, and has been changed!
Clossing the Issue 👍