prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Replace `unittest.TestCase.assertRaises` with `unittest.TestCase.assertRaisesRegex`
  Some tests use `unittest.TestCase.assertRaises` to test an exception is raised for illegal operations, but they need to be replaces with `unittest.TestCase.assertRaisesRegex`.
  
  ### Why do we need this change?
  
  Let's say we have a function that raises an exception:
  
  ```python
  def throw_exception(...):
      if condition_1:
          raise TypeError("condition_1")
      if condition_2:
          raise TypeError("condition_2")
      ...
  ```
  
  If we test this function using `assertRaises`:
  
  ```python
  class MyTest(unittest.TestCase):
      def test_throw_exception(self):
          # Does `throw_exception` really raise the second TypeError?
          # It might throw the first TypeError, then the test will pass.
          with self.assertRaises(TypeError):
              throw_exception(...)  # should raise TypeError("condition_2")
  ```
  
  If we test this function using `assertRaisesRegex`:
  
  ```python
  class MyTest(unittest.TestCase):
      def test_throw_exception(self):
          # This test fails when `throw_exception` raises the first TypeError.
          with self. assertRaisesRegex(TypeError, "condition_b"):
              throw_exception(...)  # should raise TypeError("condition_2")
  ```
  
  ### Example
  
  https://github.com/mlflow/mlflow/blob/fe6618823a2e6038149ee0da675503d2764552ca/tests/store/tracking/test_sqlalchemy_store.py#L107
  
  The code above needs to be fixed to the following:
  
  ```python
   # "<string that matches the error message>" must be replaced
   with self.assertRaisesRegex(MlflowException, "<string that matches the error message>") as e:
  ```
  
  ### References
  
  - https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises
  - https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex
  
  ### Instructions
  
  https://github.com/mlflow/mlflow/blob/101ad6e8eb383c769178df0df83d1d2a1cea6b4a/pylint_plugins/assert_raises_without_msg.py#L20-L33
  
  Ping me with the file you want to work on :)
  
  | File                                                  | Assignee    | PR    | Done |
  | :---------------------------------------------------- | :---------- | :---- | :--- |
  | `tests/entities/test_run_status.py`                   | @Sumanth077 |       |      |
  | `tests/store/model_registry/test_sqlalchemy_store.py` | @ognis1205  | #5875 | ✅   |
  | `tests/store/db/test_utils.py`                        | @erich-db   |       |      |
  | `tests/store/tracking/__init__.py`                    | @Sumanth077 |       |      |
  | `tests/store/tracking/test_file_store.py`             | @andy1122   |       |      |
  | `tests/store/tracking/test_sqlalchemy_store.py`       | @ognis1205  | #5875 | ✅   |
  
  
  --- 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/unittest_assert_raises.py`
  Content:
  ```
  1 import os
  2 
  3 import astroid
  4 from pylint.interfaces import IAstroidChecker
  5 from pylint.checkers import BaseChecker
  6 
  7 
  8 def _is_unittest_assert_raises(node: astroid.Call):
  9     return isinstance(node.func, astroid.Attribute) and node.func.as_string() == "self.assertRaises"
  10 
  11 
  12 IGNORE_FILES = list(
  13     map(
  14         os.path.abspath,
  15         [
  16             # Instructions
  17             # ============
  18             # 1. Select a file in the list below and remove it.
  19             # 2. Run pylint and confirm it fails.
  20             # 3. Fix the lines printed out in the previous step.
  21             # 4. Run pylint again and confirm it succeeds now.
  22             # 5. Run pytest and confirm the changed lines don't fail.
  23             # 6. Open a PR.
  24             "tests/entities/test_run_status.py",
  25             "tests/store/db/test_utils.py",
  26             "tests/store/tracking/__init__.py",
  27             "tests/store/tracking/test_file_store.py",
  28         ],
  29     )
  30 )
  31 
  32 
  33 def _should_ignore(path: str):
  34     return path in IGNORE_FILES
  35 
  36 
  37 class UnittestAssertRaises(BaseChecker):
  38     __implements__ = IAstroidChecker
  39 
  40     name = "unittest-assert-raises"
  41     msgs = {
  42         "W0003": (
  43             "`assertRaises` must be replaced with `assertRaisesRegex`",
  44             name,
  45             "Use `assertRaisesRegex` instead",
  46         ),
  47     }
  48     priority = -1
  49 
  50     def visit_call(self, node: astroid.Call):
  51         if not _should_ignore(node.root().file) and _is_unittest_assert_raises(node):
  52             self.add_message(self.name, node=node)
  53
  ```
  --- 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/unittest_assert_raises.py b/pylint_plugins/unittest_assert_raises.py
  --- a/pylint_plugins/unittest_assert_raises.py
  +++ b/pylint_plugins/unittest_assert_raises.py
  @@ -1,5 +1,3 @@
  -import os
  -
   import astroid
   from pylint.interfaces import IAstroidChecker
   from pylint.checkers import BaseChecker
  @@ -9,31 +7,6 @@
       return isinstance(node.func, astroid.Attribute) and node.func.as_string() == "self.assertRaises"
   
   
  -IGNORE_FILES = list(
  -    map(
  -        os.path.abspath,
  -        [
  -            # Instructions
  -            # ============
  -            # 1. Select a file in the list below and remove it.
  -            # 2. Run pylint and confirm it fails.
  -            # 3. Fix the lines printed out in the previous step.
  -            # 4. Run pylint again and confirm it succeeds now.
  -            # 5. Run pytest and confirm the changed lines don't fail.
  -            # 6. Open a PR.
  -            "tests/entities/test_run_status.py",
  -            "tests/store/db/test_utils.py",
  -            "tests/store/tracking/__init__.py",
  -            "tests/store/tracking/test_file_store.py",
  -        ],
  -    )
  -)
  -
  -
  -def _should_ignore(path: str):
  -    return path in IGNORE_FILES
  -
  -
   class UnittestAssertRaises(BaseChecker):
       __implements__ = IAstroidChecker
   
  @@ -48,5 +21,5 @@
       priority = -1
   
       def visit_call(self, node: astroid.Call):
  -        if not _should_ignore(node.root().file) and _is_unittest_assert_raises(node):
  +        if _is_unittest_assert_raises(node):
               self.add_message(self.name, node=node)
  
verification_info: {"golden_diff": "diff --git a/pylint_plugins/unittest_assert_raises.py b/pylint_plugins/unittest_assert_raises.py\n--- a/pylint_plugins/unittest_assert_raises.py\n+++ b/pylint_plugins/unittest_assert_raises.py\n@@ -1,5 +1,3 @@\n-import os\n-\n import astroid\n from pylint.interfaces import IAstroidChecker\n from pylint.checkers import BaseChecker\n@@ -9,31 +7,6 @@\n     return isinstance(node.func, astroid.Attribute) and node.func.as_string() == \"self.assertRaises\"\n \n \n-IGNORE_FILES = list(\n-    map(\n-        os.path.abspath,\n-        [\n-            # Instructions\n-            # ============\n-            # 1. Select a file in the list below and remove it.\n-            # 2. Run pylint and confirm it fails.\n-            # 3. Fix the lines printed out in the previous step.\n-            # 4. Run pylint again and confirm it succeeds now.\n-            # 5. Run pytest and confirm the changed lines don't fail.\n-            # 6. Open a PR.\n-            \"tests/entities/test_run_status.py\",\n-            \"tests/store/db/test_utils.py\",\n-            \"tests/store/tracking/__init__.py\",\n-            \"tests/store/tracking/test_file_store.py\",\n-        ],\n-    )\n-)\n-\n-\n-def _should_ignore(path: str):\n-    return path in IGNORE_FILES\n-\n-\n class UnittestAssertRaises(BaseChecker):\n     __implements__ = IAstroidChecker\n \n@@ -48,5 +21,5 @@\n     priority = -1\n \n     def visit_call(self, node: astroid.Call):\n-        if not _should_ignore(node.root().file) and _is_unittest_assert_raises(node):\n+        if _is_unittest_assert_raises(node):\n             self.add_message(self.name, node=node)\n", "issue": "Replace `unittest.TestCase.assertRaises` with `unittest.TestCase.assertRaisesRegex`\nSome tests use `unittest.TestCase.assertRaises` to test an exception is raised for illegal operations, but they need to be replaces with `unittest.TestCase.assertRaisesRegex`.\r\n\r\n### Why do we need this change?\r\n\r\nLet's say we have a function that raises an exception:\r\n\r\n```python\r\ndef throw_exception(...):\r\n    if condition_1:\r\n        raise TypeError(\"condition_1\")\r\n    if condition_2:\r\n        raise TypeError(\"condition_2\")\r\n    ...\r\n```\r\n\r\nIf we test this function using `assertRaises`:\r\n\r\n```python\r\nclass MyTest(unittest.TestCase):\r\n    def test_throw_exception(self):\r\n        # Does `throw_exception` really raise the second TypeError?\r\n        # It might throw the first TypeError, then the test will pass.\r\n        with self.assertRaises(TypeError):\r\n            throw_exception(...)  # should raise TypeError(\"condition_2\")\r\n```\r\n\r\nIf we test this function using `assertRaisesRegex`:\r\n\r\n```python\r\nclass MyTest(unittest.TestCase):\r\n    def test_throw_exception(self):\r\n        # This test fails when `throw_exception` raises the first TypeError.\r\n        with self. assertRaisesRegex(TypeError, \"condition_b\"):\r\n            throw_exception(...)  # should raise TypeError(\"condition_2\")\r\n```\r\n\r\n### Example\r\n\r\nhttps://github.com/mlflow/mlflow/blob/fe6618823a2e6038149ee0da675503d2764552ca/tests/store/tracking/test_sqlalchemy_store.py#L107\r\n\r\nThe code above needs to be fixed to the following:\r\n\r\n```python\r\n # \"<string that matches the error message>\" must be replaced\r\n with self.assertRaisesRegex(MlflowException, \"<string that matches the error message>\") as e:\r\n```\r\n\r\n### References\r\n\r\n- https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises\r\n- https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex\r\n\r\n### Instructions\r\n\r\nhttps://github.com/mlflow/mlflow/blob/101ad6e8eb383c769178df0df83d1d2a1cea6b4a/pylint_plugins/assert_raises_without_msg.py#L20-L33\r\n\r\nPing me with the file you want to work on :)\r\n\r\n| File                                                  | Assignee    | PR    | Done |\r\n| :---------------------------------------------------- | :---------- | :---- | :--- |\r\n| `tests/entities/test_run_status.py`                   | @Sumanth077 |       |      |\r\n| `tests/store/model_registry/test_sqlalchemy_store.py` | @ognis1205  | #5875 | \u2705   |\r\n| `tests/store/db/test_utils.py`                        | @erich-db   |       |      |\r\n| `tests/store/tracking/__init__.py`                    | @Sumanth077 |       |      |\r\n| `tests/store/tracking/test_file_store.py`             | @andy1122   |       |      |\r\n| `tests/store/tracking/test_sqlalchemy_store.py`       | @ognis1205  | #5875 | \u2705   |\r\n\n", "before_files": [{"content": "import os\n\nimport astroid\nfrom pylint.interfaces import IAstroidChecker\nfrom pylint.checkers import BaseChecker\n\n\ndef _is_unittest_assert_raises(node: astroid.Call):\n    return isinstance(node.func, astroid.Attribute) and node.func.as_string() == \"self.assertRaises\"\n\n\nIGNORE_FILES = list(\n    map(\n        os.path.abspath,\n        [\n            # Instructions\n            # ============\n            # 1. Select a file in the list below and remove it.\n            # 2. Run pylint and confirm it fails.\n            # 3. Fix the lines printed out in the previous step.\n            # 4. Run pylint again and confirm it succeeds now.\n            # 5. Run pytest and confirm the changed lines don't fail.\n            # 6. Open a PR.\n            \"tests/entities/test_run_status.py\",\n            \"tests/store/db/test_utils.py\",\n            \"tests/store/tracking/__init__.py\",\n            \"tests/store/tracking/test_file_store.py\",\n        ],\n    )\n)\n\n\ndef _should_ignore(path: str):\n    return path in IGNORE_FILES\n\n\nclass UnittestAssertRaises(BaseChecker):\n    __implements__ = IAstroidChecker\n\n    name = \"unittest-assert-raises\"\n    msgs = {\n        \"W0003\": (\n            \"`assertRaises` must be replaced with `assertRaisesRegex`\",\n            name,\n            \"Use `assertRaisesRegex` instead\",\n        ),\n    }\n    priority = -1\n\n    def visit_call(self, node: astroid.Call):\n        if not _should_ignore(node.root().file) and _is_unittest_assert_raises(node):\n            self.add_message(self.name, node=node)\n", "path": "pylint_plugins/unittest_assert_raises.py"}], "after_files": [{"content": "import astroid\nfrom pylint.interfaces import IAstroidChecker\nfrom pylint.checkers import BaseChecker\n\n\ndef _is_unittest_assert_raises(node: astroid.Call):\n    return isinstance(node.func, astroid.Attribute) and node.func.as_string() == \"self.assertRaises\"\n\n\nclass UnittestAssertRaises(BaseChecker):\n    __implements__ = IAstroidChecker\n\n    name = \"unittest-assert-raises\"\n    msgs = {\n        \"W0003\": (\n            \"`assertRaises` must be replaced with `assertRaisesRegex`\",\n            name,\n            \"Use `assertRaisesRegex` instead\",\n        ),\n    }\n    priority = -1\n\n    def visit_call(self, node: astroid.Call):\n        if _is_unittest_assert_raises(node):\n            self.add_message(self.name, node=node)\n", "path": "pylint_plugins/unittest_assert_raises.py"}]}