File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed
Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 11import asyncio
2- import inspect
3- import sys
42import time
5- import traceback
63import unittest
74import os
85import json
1613from influxdb_client_3 import InfluxDBClient3
1714from influxdb_client_3 .query .query_api import QueryApiOptionsBuilder , QueryApi
1815from influxdb_client_3 .version import USER_AGENT
16+ from tests .util import asyncio_run
1917
2018from tests .util .mocks import (
2119 ConstantData ,
2927)
3028
3129
32- def asyncio_run (async_func ):
33- def wrapper (* args , ** kwargs ):
34- try :
35- return asyncio .run (async_func (* args , ** kwargs ))
36- except Exception as e :
37- print (traceback .format_exc (), file = sys .stderr )
38- raise e
39-
40- wrapper .__signature__ = inspect .signature (async_func )
41- return wrapper
42-
43-
4430def case_insensitive_header_lookup (headers , lkey ):
4531 """Lookup the value of a given key in the given headers.
4632 The lkey is case-insensitive.
Original file line number Diff line number Diff line change 11"""Package for tests/util module."""
2+ import asyncio
3+ import inspect
4+ import sys
5+ import traceback
6+
7+
8+ def asyncio_run (async_func ):
9+ def wrapper (* args , ** kwargs ):
10+ try :
11+ return asyncio .run (async_func (* args , ** kwargs ))
12+ except Exception as e :
13+ print (traceback .format_exc (), file = sys .stderr )
14+ raise e
15+
16+ wrapper .__signature__ = inspect .signature (async_func )
17+ return wrapper
You can’t perform that action at this time.
0 commit comments