prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Make event test more specific
                @matmair [this CI failure](https://github.com/inventree/InvenTree/actions/runs/5259899543/jobs/9506168595?pr=4732) is the last in the current batch of weird ones. I'm seeing it on multiple PRs, about 50% of the time.
  
  Here's the failing line:
  
  https://github.com/inventree/InvenTree/blob/c8365ccd0c9371ea4d127fe616e0029f35b3c19c/InvenTree/plugin/samples/event/test_event_sample.py#L27
  
  Sometimes, `cm.warning.args[0]` returns an "unclosed file object", rather than a string. Any ideas?
  
  _Originally posted by @SchrodingersGat in https://github.com/inventree/InvenTree/issues/4732#issuecomment-1590219025_
              
  
  </issue>
  <code>
  [start of InvenTree/plugin/samples/event/event_sample.py]
  1 """Sample plugin which responds to events."""
  2 
  3 import warnings
  4 
  5 from django.conf import settings
  6 
  7 from plugin import InvenTreePlugin
  8 from plugin.mixins import EventMixin
  9 
  10 
  11 class EventPluginSample(EventMixin, InvenTreePlugin):
  12     """A sample plugin which provides supports for triggered events."""
  13 
  14     NAME = "EventPlugin"
  15     SLUG = "sampleevent"
  16     TITLE = "Triggered Events"
  17 
  18     def process_event(self, event, *args, **kwargs):
  19         """Custom event processing."""
  20         print(f"Processing triggered event: '{event}'")
  21         print("args:", str(args))
  22         print("kwargs:", str(kwargs))
  23 
  24         # Issue warning that we can test for
  25         if settings.PLUGIN_TESTING:
  26             warnings.warn(f'Event `{event}` triggered', stacklevel=2)
  27
  [end of InvenTree/plugin/samples/event/event_sample.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/InvenTree/plugin/samples/event/event_sample.py b/InvenTree/plugin/samples/event/event_sample.py
  --- a/InvenTree/plugin/samples/event/event_sample.py
  +++ b/InvenTree/plugin/samples/event/event_sample.py
  @@ -1,12 +1,14 @@
   """Sample plugin which responds to events."""
   
  -import warnings
  +import logging
   
   from django.conf import settings
   
   from plugin import InvenTreePlugin
   from plugin.mixins import EventMixin
   
  +logger = logging.getLogger('inventree')
  +
   
   class EventPluginSample(EventMixin, InvenTreePlugin):
       """A sample plugin which provides supports for triggered events."""
  @@ -23,4 +25,4 @@
   
           # Issue warning that we can test for
           if settings.PLUGIN_TESTING:
  -            warnings.warn(f'Event `{event}` triggered', stacklevel=2)
  +            logger.debug(f'Event `{event}` triggered in sample plugin')
  
verification_info: {"golden_diff": "diff --git a/InvenTree/plugin/samples/event/event_sample.py b/InvenTree/plugin/samples/event/event_sample.py\n--- a/InvenTree/plugin/samples/event/event_sample.py\n+++ b/InvenTree/plugin/samples/event/event_sample.py\n@@ -1,12 +1,14 @@\n \"\"\"Sample plugin which responds to events.\"\"\"\n \n-import warnings\n+import logging\n \n from django.conf import settings\n \n from plugin import InvenTreePlugin\n from plugin.mixins import EventMixin\n \n+logger = logging.getLogger('inventree')\n+\n \n class EventPluginSample(EventMixin, InvenTreePlugin):\n     \"\"\"A sample plugin which provides supports for triggered events.\"\"\"\n@@ -23,4 +25,4 @@\n \n         # Issue warning that we can test for\n         if settings.PLUGIN_TESTING:\n-            warnings.warn(f'Event `{event}` triggered', stacklevel=2)\n+            logger.debug(f'Event `{event}` triggered in sample plugin')\n", "issue": "Make event test more specific\n              @matmair [this CI failure](https://github.com/inventree/InvenTree/actions/runs/5259899543/jobs/9506168595?pr=4732) is the last in the current batch of weird ones. I'm seeing it on multiple PRs, about 50% of the time.\r\n\r\nHere's the failing line:\r\n\r\nhttps://github.com/inventree/InvenTree/blob/c8365ccd0c9371ea4d127fe616e0029f35b3c19c/InvenTree/plugin/samples/event/test_event_sample.py#L27\r\n\r\nSometimes, `cm.warning.args[0]` returns an \"unclosed file object\", rather than a string. Any ideas?\r\n\r\n_Originally posted by @SchrodingersGat in https://github.com/inventree/InvenTree/issues/4732#issuecomment-1590219025_\r\n            \n", "before_files": [{"content": "\"\"\"Sample plugin which responds to events.\"\"\"\n\nimport warnings\n\nfrom django.conf import settings\n\nfrom plugin import InvenTreePlugin\nfrom plugin.mixins import EventMixin\n\n\nclass EventPluginSample(EventMixin, InvenTreePlugin):\n    \"\"\"A sample plugin which provides supports for triggered events.\"\"\"\n\n    NAME = \"EventPlugin\"\n    SLUG = \"sampleevent\"\n    TITLE = \"Triggered Events\"\n\n    def process_event(self, event, *args, **kwargs):\n        \"\"\"Custom event processing.\"\"\"\n        print(f\"Processing triggered event: '{event}'\")\n        print(\"args:\", str(args))\n        print(\"kwargs:\", str(kwargs))\n\n        # Issue warning that we can test for\n        if settings.PLUGIN_TESTING:\n            warnings.warn(f'Event `{event}` triggered', stacklevel=2)\n", "path": "InvenTree/plugin/samples/event/event_sample.py"}]}