prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  test_pyx problem
  I have a unit test that uses scapy library like this:
  ```
  $ cat ut.py 
  from scapy.all import *
  
  def test_foo():
      pass
  ```
  The problem is that testing framework (pytest) detects internal scapy function test_pyx as a test:
  ```
  ut.py::test_foo PASSED
  ut.py::test_pyx <- venv/src/scapy/scapy/consts.py PASSED
  ```
  This is because test_pyx function from scapy/consts.py is unnecessarily imported from scapy.all
  and pytest treats all test_* functions as tests.
  
  Scapy from current master branch.
  
  
  
  </issue>
  <code>
  [start of scapy/consts.py]
  1 ## This file is part of Scapy
  2 ## See http://www.secdev.org/projects/scapy for more informations
  3 ## Copyright (C) Philippe Biondi <phil@secdev.org>
  4 ## This program is published under a GPLv2 license
  5 
  6 import os, inspect
  7 from sys import platform, maxsize
  8 import platform as platform_lib
  9 from scapy.error import *
  10 
  11 import subprocess
  12 
  13 try:
  14     from matplotlib import get_backend as matplotlib_get_backend
  15     import matplotlib.pyplot as plt
  16     MATPLOTLIB = 1
  17     if "inline" in matplotlib_get_backend():
  18         MATPLOTLIB_INLINED = 1
  19     else:
  20         MATPLOTLIB_INLINED = 0
  21     MATPLOTLIB_DEFAULT_PLOT_KARGS = {"marker": "+"}
  22 # RuntimeError to catch gtk "Cannot open display" error
  23 except (ImportError, RuntimeError):
  24     plt = None
  25     MATPLOTLIB = 0
  26     MATPLOTLIB_INLINED = 0
  27     MATPLOTLIB_DEFAULT_PLOT_KARGS = dict()
  28     log_loading.info("Can't import matplotlib. Won't be able to plot.")
  29 
  30 def test_pyx():
  31     """Returns if PyX is correctly installed or not"""
  32     try:
  33         with open(os.devnull, 'wb') as devnull:
  34             r = subprocess.check_call(["pdflatex", "--version"], stdout=devnull, stderr=subprocess.STDOUT)
  35     except:
  36         return False
  37     else:
  38         return r == 0
  39 
  40 try:
  41     import pyx
  42     if test_pyx():
  43         PYX = 1
  44     else:
  45         log_loading.warning("PyX dependencies are not installed ! Please install TexLive or MikTeX.")
  46         PYX = 0
  47 except ImportError:
  48     log_loading.info("Can't import PyX. Won't be able to use psdump() or pdfdump().")
  49     PYX = 0
  50 
  51 
  52 LINUX = platform.startswith("linux")
  53 OPENBSD = platform.startswith("openbsd")
  54 FREEBSD = "freebsd" in platform
  55 NETBSD = platform.startswith("netbsd")
  56 DARWIN = platform.startswith("darwin")
  57 SOLARIS = platform.startswith("sunos")
  58 WINDOWS = platform.startswith("win32")
  59 BSD = DARWIN or FREEBSD or OPENBSD or NETBSD
  60 # See https://docs.python.org/3/library/platform.html#cross-platform
  61 IS_64BITS = maxsize > 2**32
  62 
  63 if WINDOWS:
  64     try:
  65         if float(platform_lib.release()) >= 8.1:
  66             LOOPBACK_NAME = "Microsoft KM-TEST Loopback Adapter"
  67         else:
  68             LOOPBACK_NAME = "Microsoft Loopback Adapter"
  69     except ValueError:
  70         LOOPBACK_NAME = "Microsoft Loopback Adapter"
  71     # Will be different on Windows
  72     LOOPBACK_INTERFACE = None
  73 else:
  74     uname = os.uname()
  75     LOOPBACK_NAME = "lo" if LINUX else "lo0"
  76     LOOPBACK_INTERFACE = LOOPBACK_NAME
  77 
  78 def parent_function():
  79     return inspect.getouterframes(inspect.currentframe())
  80
  [end of scapy/consts.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/scapy/consts.py b/scapy/consts.py
  --- a/scapy/consts.py
  +++ b/scapy/consts.py
  @@ -27,7 +27,7 @@
       MATPLOTLIB_DEFAULT_PLOT_KARGS = dict()
       log_loading.info("Can't import matplotlib. Won't be able to plot.")
   
  -def test_pyx():
  +def _test_pyx():
       """Returns if PyX is correctly installed or not"""
       try:
           with open(os.devnull, 'wb') as devnull:
  @@ -39,7 +39,7 @@
   
   try:
       import pyx
  -    if test_pyx():
  +    if _test_pyx():
           PYX = 1
       else:
           log_loading.warning("PyX dependencies are not installed ! Please install TexLive or MikTeX.")
  
verification_info: {"golden_diff": "diff --git a/scapy/consts.py b/scapy/consts.py\n--- a/scapy/consts.py\n+++ b/scapy/consts.py\n@@ -27,7 +27,7 @@\n     MATPLOTLIB_DEFAULT_PLOT_KARGS = dict()\n     log_loading.info(\"Can't import matplotlib. Won't be able to plot.\")\n \n-def test_pyx():\n+def _test_pyx():\n     \"\"\"Returns if PyX is correctly installed or not\"\"\"\n     try:\n         with open(os.devnull, 'wb') as devnull:\n@@ -39,7 +39,7 @@\n \n try:\n     import pyx\n-    if test_pyx():\n+    if _test_pyx():\n         PYX = 1\n     else:\n         log_loading.warning(\"PyX dependencies are not installed ! Please install TexLive or MikTeX.\")\n", "issue": "test_pyx problem\nI have a unit test that uses scapy library like this:\r\n```\r\n$ cat ut.py \r\nfrom scapy.all import *\r\n\r\ndef test_foo():\r\n    pass\r\n```\r\nThe problem is that testing framework (pytest) detects internal scapy function test_pyx as a test:\r\n```\r\nut.py::test_foo PASSED\r\nut.py::test_pyx <- venv/src/scapy/scapy/consts.py PASSED\r\n```\r\nThis is because test_pyx function from scapy/consts.py is unnecessarily imported from scapy.all\r\nand pytest treats all test_* functions as tests.\r\n\r\nScapy from current master branch.\r\n\r\n\n", "before_files": [{"content": "## This file is part of Scapy\n## See http://www.secdev.org/projects/scapy for more informations\n## Copyright (C) Philippe Biondi <phil@secdev.org>\n## This program is published under a GPLv2 license\n\nimport os, inspect\nfrom sys import platform, maxsize\nimport platform as platform_lib\nfrom scapy.error import *\n\nimport subprocess\n\ntry:\n    from matplotlib import get_backend as matplotlib_get_backend\n    import matplotlib.pyplot as plt\n    MATPLOTLIB = 1\n    if \"inline\" in matplotlib_get_backend():\n        MATPLOTLIB_INLINED = 1\n    else:\n        MATPLOTLIB_INLINED = 0\n    MATPLOTLIB_DEFAULT_PLOT_KARGS = {\"marker\": \"+\"}\n# RuntimeError to catch gtk \"Cannot open display\" error\nexcept (ImportError, RuntimeError):\n    plt = None\n    MATPLOTLIB = 0\n    MATPLOTLIB_INLINED = 0\n    MATPLOTLIB_DEFAULT_PLOT_KARGS = dict()\n    log_loading.info(\"Can't import matplotlib. Won't be able to plot.\")\n\ndef test_pyx():\n    \"\"\"Returns if PyX is correctly installed or not\"\"\"\n    try:\n        with open(os.devnull, 'wb') as devnull:\n            r = subprocess.check_call([\"pdflatex\", \"--version\"], stdout=devnull, stderr=subprocess.STDOUT)\n    except:\n        return False\n    else:\n        return r == 0\n\ntry:\n    import pyx\n    if test_pyx():\n        PYX = 1\n    else:\n        log_loading.warning(\"PyX dependencies are not installed ! Please install TexLive or MikTeX.\")\n        PYX = 0\nexcept ImportError:\n    log_loading.info(\"Can't import PyX. Won't be able to use psdump() or pdfdump().\")\n    PYX = 0\n\n\nLINUX = platform.startswith(\"linux\")\nOPENBSD = platform.startswith(\"openbsd\")\nFREEBSD = \"freebsd\" in platform\nNETBSD = platform.startswith(\"netbsd\")\nDARWIN = platform.startswith(\"darwin\")\nSOLARIS = platform.startswith(\"sunos\")\nWINDOWS = platform.startswith(\"win32\")\nBSD = DARWIN or FREEBSD or OPENBSD or NETBSD\n# See https://docs.python.org/3/library/platform.html#cross-platform\nIS_64BITS = maxsize > 2**32\n\nif WINDOWS:\n    try:\n        if float(platform_lib.release()) >= 8.1:\n            LOOPBACK_NAME = \"Microsoft KM-TEST Loopback Adapter\"\n        else:\n            LOOPBACK_NAME = \"Microsoft Loopback Adapter\"\n    except ValueError:\n        LOOPBACK_NAME = \"Microsoft Loopback Adapter\"\n    # Will be different on Windows\n    LOOPBACK_INTERFACE = None\nelse:\n    uname = os.uname()\n    LOOPBACK_NAME = \"lo\" if LINUX else \"lo0\"\n    LOOPBACK_INTERFACE = LOOPBACK_NAME\n\ndef parent_function():\n    return inspect.getouterframes(inspect.currentframe())\n", "path": "scapy/consts.py"}]}