Closed nbassler closed 6 months ago
Interesting, what would happen if you change it to e.value == 2
? The idea of that test is to check for non-zero exit code if no arguments are provided.
You can put any value there, the assert line is not evaluated. :) Remove one indention, and it will behave as it should.
You are right ! pytest documentation says so as well: https://docs.pytest.org/en/4.6.x/reference.html#pytest-raises
e.g. the mcscripter test...
https://github.com/DataMedSci/pymchelper/blob/f39907b8dd6262fe6a1bf2f40ed170e4a5b7a5ee/tests/test_mcscripter.py#L54C1-L59C28
the assertion is never reached, so the test will always pass. I saw this pattern a few places at various tests.