1From 28eac38566327091221aabbc164ea8e433c66e7e Mon Sep 17 00:00:00 2001
2From: Tim Orling <tim.orling@konsulko.com>
3Date: Sun, 24 Dec 2023 09:27:50 -0800
4Subject: [PATCH 2/2] Fix import of tests.utils to enable pytest
5
6Running the test cases with pytest leads to importlib errors
7because the "utils" module cannot be found.
8
9Upstream-Status: Submitted [https://github.com/sumerc/yappi/pull/164]
10
11Signed-off-by: Tim Orling <tim.orling@konsulko.com>
12---
13 tests/test_asyncio.py              | 2 +-
14 tests/test_asyncio_context_vars.py | 2 +-
15 tests/test_functionality.py        | 2 +-
16 tests/test_gevent.py               | 2 +-
17 tests/test_hooks.py                | 2 +-
18 tests/test_tags.py                 | 2 +-
19 6 files changed, 6 insertions(+), 6 deletions(-)
20
21diff --git a/tests/test_asyncio.py b/tests/test_asyncio.py
22index 8e9e631..bb36f4a 100644
23--- a/tests/test_asyncio.py
24+++ b/tests/test_asyncio.py
25@@ -2,7 +2,7 @@ import unittest
26 import yappi
27 import asyncio
28 import threading
29-from utils import YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io
30+from tests.utils import YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io
31
32
33 async def async_sleep(sec):
34diff --git a/tests/test_asyncio_context_vars.py b/tests/test_asyncio_context_vars.py
35index 5bd750c..9a253c0 100644
36--- a/tests/test_asyncio_context_vars.py
37+++ b/tests/test_asyncio_context_vars.py
38@@ -5,7 +5,7 @@ import contextvars
39 import functools
40 import time
41 import os
42-import utils
43+import tests.utils as utils
44 import yappi
45
46 async_context_id = contextvars.ContextVar('async_context_id')
47diff --git a/tests/test_functionality.py b/tests/test_functionality.py
48index 38bbe67..8098f17 100644
49--- a/tests/test_functionality.py
50+++ b/tests/test_functionality.py
51@@ -5,7 +5,7 @@ import threading
52 import unittest
53 import yappi
54 import _yappi
55-import utils
56+import tests.utils as utils
57 import multiprocessing
58 import subprocess
59
60diff --git a/tests/test_gevent.py b/tests/test_gevent.py
61index ed9e6ae..502af5f 100644
62--- a/tests/test_gevent.py
63+++ b/tests/test_gevent.py
64@@ -2,7 +2,7 @@ import unittest
65 import _yappi
66 import yappi
67 import threading
68-from utils import (
69+from tests.utils import (
70     YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io, burn_io_gevent
71 )
72
73diff --git a/tests/test_hooks.py b/tests/test_hooks.py
74index 297c643..8c387fc 100644
75--- a/tests/test_hooks.py
76+++ b/tests/test_hooks.py
77@@ -5,7 +5,7 @@ import unittest
78 import time
79
80 import yappi
81-import utils
82+import tests.utils as utils
83
84
85 def a():
86diff --git a/tests/test_tags.py b/tests/test_tags.py
87index b0b531d..b5a4016 100644
88--- a/tests/test_tags.py
89+++ b/tests/test_tags.py
90@@ -2,7 +2,7 @@ import unittest
91 import yappi
92 import threading
93 import time
94-from utils import YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io
95+from tests.utils import YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io
96
97
98 class MultiThreadTests(YappiUnitTestCase):
99--
1002.34.1
101
102