prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Enable `PT011`
  ### Summary
  
  Enable https://beta.ruff.rs/docs/rules/pytest-raises-too-broad.
  
  ```diff
  diff --git a/pyproject.toml b/pyproject.toml
  index c373b48ca..8b7810c04 100644
  --- a/pyproject.toml
  +++ b/pyproject.toml
  @@ -25,6 +25,7 @@ select = [
     "PT009",
     "PT010",
     "PT012",
  +  "PT011",
     "PT013",
     "PT018",
     "PT022",
  @@ -72,6 +73,7 @@ extend-exclude = [
   [tool.ruff.flake8-pytest-style]
   mark-parentheses = false
   fixture-parentheses = false
  +raises-require-match-for = ["*"]
   
   [tool.ruff.flake8-tidy-imports]
   ban-relative-imports = "all"
  ```
  
  - `raises-require-match-for = ["*"]` means all errors require `match`.
  
  ### Notes
  
  - Make sure to open a PR from a **non-master** branch.
  - Sign off the commit using the `-s` flag when making a commit:
  
    ```sh
    git commit -s -m "..."
             # ^^ make sure to use this
    ```
  
  - Include `#{issue_number}` (e.g. `#123`) in the PR description when opening a PR.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pylint_plugins/__init__.py`
  Content:
  ```
  1 from pylint_plugins.pytest_raises_checker import PytestRaisesChecker
  2 from pylint_plugins.unittest_assert_raises import UnittestAssertRaises
  3 from pylint_plugins.import_checker import ImportChecker
  4 from pylint_plugins.assign_checker import AssignChecker
  5 
  6 
  7 def register(linter):
  8     linter.register_checker(PytestRaisesChecker(linter))
  9     linter.register_checker(UnittestAssertRaises(linter))
  10     linter.register_checker(ImportChecker(linter))
  11     linter.register_checker(AssignChecker(linter))
  12
  ```
  
  Path: `pylint_plugins/errors.py`
  Content:
  ```
  1 from typing import NamedTuple, Dict, Tuple
  2 from functools import reduce
  3 
  4 
  5 class Message(NamedTuple):
  6     id: str
  7     name: str
  8     message: str
  9     reason: str
  10 
  11     def to_dict(self) -> Dict[str, Tuple[str, str, str]]:
  12         return {self.id: (self.message, self.name, self.reason)}
  13 
  14 
  15 def to_msgs(*messages: Message) -> Dict[str, Tuple[str, str, str]]:
  16     return reduce(lambda x, y: {**x, **y.to_dict()}, messages, {})
  17 
  18 
  19 PYTEST_RAISES_WITHOUT_MATCH = Message(
  20     id="W0001",
  21     name="pytest-raises-without-match",
  22     message="`pytest.raises` must be called with `match` argument`.",
  23     reason="`pytest.raises` without `match` argument can lead to false positives.",
  24 )
  25 
  26 
  27 UNITTEST_PYTEST_RAISES = Message(
  28     id="W0003",
  29     name="unittest-assert-raises",
  30     message="Use `pytest.raises` instead of `unittest.TestCase.assertRaises`.",
  31     reason="To enforce 'pytest-raises-multiple-statements' Message.",
  32 )
  33 
  34 
  35 LAZY_BUILTIN_IMPORT = Message(
  36     id="W0007",
  37     name="lazy-builtin-import",
  38     message="Import built-in module(s) (%s) at the top of the file.",
  39     reason="There is no reason they should be imported inside a function.",
  40 )
  41 
  42 USELESS_ASSIGNMENT = Message(
  43     id="W0008",
  44     name="useless-assignment",
  45     message="Useless assignment. Use immediate return instead.",
  46     reason="For simplicity and readability",
  47 )
  48
  ```
  
  Path: `pylint_plugins/pytest_raises_checker/__init__.py`
  Content:
  ```
  1 import astroid
  2 from pylint.interfaces import IAstroidChecker
  3 from pylint.checkers import BaseChecker
  4 
  5 from pylint_plugins.errors import PYTEST_RAISES_WITHOUT_MATCH, to_msgs
  6 
  7 
  8 def _is_pytest_raises_call(node: astroid.NodeNG):
  9     if not isinstance(node, astroid.Call):
  10         return False
  11     if not isinstance(node.func, astroid.Attribute) or not isinstance(node.func.expr, astroid.Name):
  12         return False
  13     return node.func.expr.name == "pytest" and node.func.attrname == "raises"
  14 
  15 
  16 def _called_with_match(node: astroid.Call):
  17     # Note `match` is a keyword-only argument:
  18     # https://docs.pytest.org/en/latest/reference/reference.html#pytest.raises
  19     return any(k.arg == "match" for k in node.keywords)
  20 
  21 
  22 def _contains_multiple_statements(raises_with: astroid.With):
  23     return len(raises_with.body) > 1
  24 
  25 
  26 class PytestRaisesChecker(BaseChecker):
  27     __implements__ = IAstroidChecker
  28 
  29     name = "pytest-raises-checker"
  30     msgs = to_msgs(PYTEST_RAISES_WITHOUT_MATCH)
  31     priority = -1
  32 
  33     def visit_call(self, node: astroid.Call):
  34         if not _is_pytest_raises_call(node):
  35             return
  36 
  37         if not _called_with_match(node):
  38             self.add_message(PYTEST_RAISES_WITHOUT_MATCH.name, node=node)
  39
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pylint_plugins/__init__.py b/pylint_plugins/__init__.py
  --- a/pylint_plugins/__init__.py
  +++ b/pylint_plugins/__init__.py
  @@ -1,11 +1,9 @@
  -from pylint_plugins.pytest_raises_checker import PytestRaisesChecker
   from pylint_plugins.unittest_assert_raises import UnittestAssertRaises
   from pylint_plugins.import_checker import ImportChecker
   from pylint_plugins.assign_checker import AssignChecker
   
   
   def register(linter):
  -    linter.register_checker(PytestRaisesChecker(linter))
       linter.register_checker(UnittestAssertRaises(linter))
       linter.register_checker(ImportChecker(linter))
       linter.register_checker(AssignChecker(linter))
  diff --git a/pylint_plugins/errors.py b/pylint_plugins/errors.py
  --- a/pylint_plugins/errors.py
  +++ b/pylint_plugins/errors.py
  @@ -16,14 +16,6 @@
       return reduce(lambda x, y: {**x, **y.to_dict()}, messages, {})
   
   
  -PYTEST_RAISES_WITHOUT_MATCH = Message(
  -    id="W0001",
  -    name="pytest-raises-without-match",
  -    message="`pytest.raises` must be called with `match` argument`.",
  -    reason="`pytest.raises` without `match` argument can lead to false positives.",
  -)
  -
  -
   UNITTEST_PYTEST_RAISES = Message(
       id="W0003",
       name="unittest-assert-raises",
  diff --git a/pylint_plugins/pytest_raises_checker/__init__.py b/pylint_plugins/pytest_raises_checker/__init__.py
  deleted file mode 100644
  --- a/pylint_plugins/pytest_raises_checker/__init__.py
  +++ /dev/null
  @@ -1,38 +0,0 @@
  -import astroid
  -from pylint.interfaces import IAstroidChecker
  -from pylint.checkers import BaseChecker
  -
  -from pylint_plugins.errors import PYTEST_RAISES_WITHOUT_MATCH, to_msgs
  -
  -
  -def _is_pytest_raises_call(node: astroid.NodeNG):
  -    if not isinstance(node, astroid.Call):
  -        return False
  -    if not isinstance(node.func, astroid.Attribute) or not isinstance(node.func.expr, astroid.Name):
  -        return False
  -    return node.func.expr.name == "pytest" and node.func.attrname == "raises"
  -
  -
  -def _called_with_match(node: astroid.Call):
  -    # Note `match` is a keyword-only argument:
  -    # https://docs.pytest.org/en/latest/reference/reference.html#pytest.raises
  -    return any(k.arg == "match" for k in node.keywords)
  -
  -
  -def _contains_multiple_statements(raises_with: astroid.With):
  -    return len(raises_with.body) > 1
  -
  -
  -class PytestRaisesChecker(BaseChecker):
  -    __implements__ = IAstroidChecker
  -
  -    name = "pytest-raises-checker"
  -    msgs = to_msgs(PYTEST_RAISES_WITHOUT_MATCH)
  -    priority = -1
  -
  -    def visit_call(self, node: astroid.Call):
  -        if not _is_pytest_raises_call(node):
  -            return
  -
  -        if not _called_with_match(node):
  -            self.add_message(PYTEST_RAISES_WITHOUT_MATCH.name, node=node)
  
verification_info: {"golden_diff": "diff --git a/pylint_plugins/__init__.py b/pylint_plugins/__init__.py\n--- a/pylint_plugins/__init__.py\n+++ b/pylint_plugins/__init__.py\n@@ -1,11 +1,9 @@\n-from pylint_plugins.pytest_raises_checker import PytestRaisesChecker\n from pylint_plugins.unittest_assert_raises import UnittestAssertRaises\n from pylint_plugins.import_checker import ImportChecker\n from pylint_plugins.assign_checker import AssignChecker\n \n \n def register(linter):\n-    linter.register_checker(PytestRaisesChecker(linter))\n     linter.register_checker(UnittestAssertRaises(linter))\n     linter.register_checker(ImportChecker(linter))\n     linter.register_checker(AssignChecker(linter))\ndiff --git a/pylint_plugins/errors.py b/pylint_plugins/errors.py\n--- a/pylint_plugins/errors.py\n+++ b/pylint_plugins/errors.py\n@@ -16,14 +16,6 @@\n     return reduce(lambda x, y: {**x, **y.to_dict()}, messages, {})\n \n \n-PYTEST_RAISES_WITHOUT_MATCH = Message(\n-    id=\"W0001\",\n-    name=\"pytest-raises-without-match\",\n-    message=\"`pytest.raises` must be called with `match` argument`.\",\n-    reason=\"`pytest.raises` without `match` argument can lead to false positives.\",\n-)\n-\n-\n UNITTEST_PYTEST_RAISES = Message(\n     id=\"W0003\",\n     name=\"unittest-assert-raises\",\ndiff --git a/pylint_plugins/pytest_raises_checker/__init__.py b/pylint_plugins/pytest_raises_checker/__init__.py\ndeleted file mode 100644\n--- a/pylint_plugins/pytest_raises_checker/__init__.py\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-import astroid\n-from pylint.interfaces import IAstroidChecker\n-from pylint.checkers import BaseChecker\n-\n-from pylint_plugins.errors import PYTEST_RAISES_WITHOUT_MATCH, to_msgs\n-\n-\n-def _is_pytest_raises_call(node: astroid.NodeNG):\n-    if not isinstance(node, astroid.Call):\n-        return False\n-    if not isinstance(node.func, astroid.Attribute) or not isinstance(node.func.expr, astroid.Name):\n-        return False\n-    return node.func.expr.name == \"pytest\" and node.func.attrname == \"raises\"\n-\n-\n-def _called_with_match(node: astroid.Call):\n-    # Note `match` is a keyword-only argument:\n-    # https://docs.pytest.org/en/latest/reference/reference.html#pytest.raises\n-    return any(k.arg == \"match\" for k in node.keywords)\n-\n-\n-def _contains_multiple_statements(raises_with: astroid.With):\n-    return len(raises_with.body) > 1\n-\n-\n-class PytestRaisesChecker(BaseChecker):\n-    __implements__ = IAstroidChecker\n-\n-    name = \"pytest-raises-checker\"\n-    msgs = to_msgs(PYTEST_RAISES_WITHOUT_MATCH)\n-    priority = -1\n-\n-    def visit_call(self, node: astroid.Call):\n-        if not _is_pytest_raises_call(node):\n-            return\n-\n-        if not _called_with_match(node):\n-            self.add_message(PYTEST_RAISES_WITHOUT_MATCH.name, node=node)\n", "issue": "Enable `PT011`\n### Summary\r\n\r\nEnable https://beta.ruff.rs/docs/rules/pytest-raises-too-broad.\r\n\r\n```diff\r\ndiff --git a/pyproject.toml b/pyproject.toml\r\nindex c373b48ca..8b7810c04 100644\r\n--- a/pyproject.toml\r\n+++ b/pyproject.toml\r\n@@ -25,6 +25,7 @@ select = [\r\n   \"PT009\",\r\n   \"PT010\",\r\n   \"PT012\",\r\n+  \"PT011\",\r\n   \"PT013\",\r\n   \"PT018\",\r\n   \"PT022\",\r\n@@ -72,6 +73,7 @@ extend-exclude = [\r\n [tool.ruff.flake8-pytest-style]\r\n mark-parentheses = false\r\n fixture-parentheses = false\r\n+raises-require-match-for = [\"*\"]\r\n \r\n [tool.ruff.flake8-tidy-imports]\r\n ban-relative-imports = \"all\"\r\n```\r\n\r\n- `raises-require-match-for = [\"*\"]` means all errors require `match`.\r\n\r\n### Notes\r\n\r\n- Make sure to open a PR from a **non-master** branch.\r\n- Sign off the commit using the `-s` flag when making a commit:\r\n\r\n  ```sh\r\n  git commit -s -m \"...\"\r\n           # ^^ make sure to use this\r\n  ```\r\n\r\n- Include `#{issue_number}` (e.g. `#123`) in the PR description when opening a PR.\r\n\n", "before_files": [{"content": "from pylint_plugins.pytest_raises_checker import PytestRaisesChecker\nfrom pylint_plugins.unittest_assert_raises import UnittestAssertRaises\nfrom pylint_plugins.import_checker import ImportChecker\nfrom pylint_plugins.assign_checker import AssignChecker\n\n\ndef register(linter):\n    linter.register_checker(PytestRaisesChecker(linter))\n    linter.register_checker(UnittestAssertRaises(linter))\n    linter.register_checker(ImportChecker(linter))\n    linter.register_checker(AssignChecker(linter))\n", "path": "pylint_plugins/__init__.py"}, {"content": "from typing import NamedTuple, Dict, Tuple\nfrom functools import reduce\n\n\nclass Message(NamedTuple):\n    id: str\n    name: str\n    message: str\n    reason: str\n\n    def to_dict(self) -> Dict[str, Tuple[str, str, str]]:\n        return {self.id: (self.message, self.name, self.reason)}\n\n\ndef to_msgs(*messages: Message) -> Dict[str, Tuple[str, str, str]]:\n    return reduce(lambda x, y: {**x, **y.to_dict()}, messages, {})\n\n\nPYTEST_RAISES_WITHOUT_MATCH = Message(\n    id=\"W0001\",\n    name=\"pytest-raises-without-match\",\n    message=\"`pytest.raises` must be called with `match` argument`.\",\n    reason=\"`pytest.raises` without `match` argument can lead to false positives.\",\n)\n\n\nUNITTEST_PYTEST_RAISES = Message(\n    id=\"W0003\",\n    name=\"unittest-assert-raises\",\n    message=\"Use `pytest.raises` instead of `unittest.TestCase.assertRaises`.\",\n    reason=\"To enforce 'pytest-raises-multiple-statements' Message.\",\n)\n\n\nLAZY_BUILTIN_IMPORT = Message(\n    id=\"W0007\",\n    name=\"lazy-builtin-import\",\n    message=\"Import built-in module(s) (%s) at the top of the file.\",\n    reason=\"There is no reason they should be imported inside a function.\",\n)\n\nUSELESS_ASSIGNMENT = Message(\n    id=\"W0008\",\n    name=\"useless-assignment\",\n    message=\"Useless assignment. Use immediate return instead.\",\n    reason=\"For simplicity and readability\",\n)\n", "path": "pylint_plugins/errors.py"}, {"content": "import astroid\nfrom pylint.interfaces import IAstroidChecker\nfrom pylint.checkers import BaseChecker\n\nfrom pylint_plugins.errors import PYTEST_RAISES_WITHOUT_MATCH, to_msgs\n\n\ndef _is_pytest_raises_call(node: astroid.NodeNG):\n    if not isinstance(node, astroid.Call):\n        return False\n    if not isinstance(node.func, astroid.Attribute) or not isinstance(node.func.expr, astroid.Name):\n        return False\n    return node.func.expr.name == \"pytest\" and node.func.attrname == \"raises\"\n\n\ndef _called_with_match(node: astroid.Call):\n    # Note `match` is a keyword-only argument:\n    # https://docs.pytest.org/en/latest/reference/reference.html#pytest.raises\n    return any(k.arg == \"match\" for k in node.keywords)\n\n\ndef _contains_multiple_statements(raises_with: astroid.With):\n    return len(raises_with.body) > 1\n\n\nclass PytestRaisesChecker(BaseChecker):\n    __implements__ = IAstroidChecker\n\n    name = \"pytest-raises-checker\"\n    msgs = to_msgs(PYTEST_RAISES_WITHOUT_MATCH)\n    priority = -1\n\n    def visit_call(self, node: astroid.Call):\n        if not _is_pytest_raises_call(node):\n            return\n\n        if not _called_with_match(node):\n            self.add_message(PYTEST_RAISES_WITHOUT_MATCH.name, node=node)\n", "path": "pylint_plugins/pytest_raises_checker/__init__.py"}], "after_files": [{"content": "from pylint_plugins.unittest_assert_raises import UnittestAssertRaises\nfrom pylint_plugins.import_checker import ImportChecker\nfrom pylint_plugins.assign_checker import AssignChecker\n\n\ndef register(linter):\n    linter.register_checker(UnittestAssertRaises(linter))\n    linter.register_checker(ImportChecker(linter))\n    linter.register_checker(AssignChecker(linter))\n", "path": "pylint_plugins/__init__.py"}, {"content": "from typing import NamedTuple, Dict, Tuple\nfrom functools import reduce\n\n\nclass Message(NamedTuple):\n    id: str\n    name: str\n    message: str\n    reason: str\n\n    def to_dict(self) -> Dict[str, Tuple[str, str, str]]:\n        return {self.id: (self.message, self.name, self.reason)}\n\n\ndef to_msgs(*messages: Message) -> Dict[str, Tuple[str, str, str]]:\n    return reduce(lambda x, y: {**x, **y.to_dict()}, messages, {})\n\n\nUNITTEST_PYTEST_RAISES = Message(\n    id=\"W0003\",\n    name=\"unittest-assert-raises\",\n    message=\"Use `pytest.raises` instead of `unittest.TestCase.assertRaises`.\",\n    reason=\"To enforce 'pytest-raises-multiple-statements' Message.\",\n)\n\n\nLAZY_BUILTIN_IMPORT = Message(\n    id=\"W0007\",\n    name=\"lazy-builtin-import\",\n    message=\"Import built-in module(s) (%s) at the top of the file.\",\n    reason=\"There is no reason they should be imported inside a function.\",\n)\n\nUSELESS_ASSIGNMENT = Message(\n    id=\"W0008\",\n    name=\"useless-assignment\",\n    message=\"Useless assignment. Use immediate return instead.\",\n    reason=\"For simplicity and readability\",\n)\n", "path": "pylint_plugins/errors.py"}, {"content": null, "path": "pylint_plugins/pytest_raises_checker/__init__.py"}]}