---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT030 `pytest.warns(EncodingWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:11:23
   |
10 | def test_ok_different_error_from_config():
11 |     with pytest.warns(EncodingWarning):
   |                       ^^^^^^^^^^^^^^^
12 |         pass
   |

PT030 `pytest.warns(UserWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:16:23
   |
15 | def test_error_no_argument_given():
16 |     with pytest.warns(UserWarning):
   |                       ^^^^^^^^^^^
17 |         pass
   |

PT030 `pytest.warns(UserWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:19:40
   |
17 |         pass
18 |
19 |     with pytest.warns(expected_warning=UserWarning):
   |                                        ^^^^^^^^^^^
20 |         pass
   |

PT030 `pytest.warns(UserWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:27:23
   |
26 | def test_error_match_is_empty():
27 |     with pytest.warns(UserWarning, match=None):
   |                       ^^^^^^^^^^^
28 |         pass
   |

PT030 `pytest.warns(UserWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:30:23
   |
28 |         pass
29 |
30 |     with pytest.warns(UserWarning, match=""):
   |                       ^^^^^^^^^^^
31 |         pass
   |

PT030 `pytest.warns(UserWarning)` is too broad, set the `match` parameter or use a more specific warning
  --> PT030.py:33:23
   |
31 |         pass
32 |
33 |     with pytest.warns(UserWarning, match=f""):
   |                       ^^^^^^^^^^^
34 |         pass
   |
