| 221 | raise KeyError("oops") |
| 222 | |
| 223 | def test_no_raise_message(self) -> None: |
| 224 | try: |
| 225 | with pytest.raises(ValueError): |
| 226 | int("0") |
| 227 | except pytest.fail.Exception as e: |
| 228 | assert e.msg == "DID NOT RAISE ValueError" |
| 229 | else: |
| 230 | assert False, "Expected pytest.raises.Exception" |
| 231 | |
| 232 | try: |
| 233 | with pytest.raises(ValueError): |
| 234 | pass |
| 235 | except pytest.fail.Exception as e: |
| 236 | assert e.msg == "DID NOT RAISE ValueError" |
| 237 | else: |
| 238 | assert False, "Expected pytest.raises.Exception" |
| 239 | |
| 240 | @pytest.mark.parametrize( |
| 241 | "method", ["function", "function_match", "with", "with_raisesexc", "with_group"] |