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