3
3
import trio
4
4
import trio_asyncio
5
5
6
- class TestThread (aiotest .TestCase ):
7
- @classmethod
8
- def setUpClass (cls ):
9
- super (ThreadTests , cls ).setUpClass ()
10
- if not cls .config .support_threads :
11
- raise aiotest .unittest .SkipTest ("threads are not supported" )
12
6
7
+ class TestThread (aiotest .TestCase ):
13
8
@pytest .mark .trio
14
9
async def test_ident (self , loop , config ):
15
10
threading = config .threading
16
11
try :
17
- get_ident = threading .get_ident # Python 3
12
+ get_ident = threading .get_ident # Python 3
18
13
except AttributeError :
19
- get_ident = threading ._get_ident # Python 2
14
+ get_ident = threading ._get_ident # Python 2
20
15
21
16
result = {'ident' : None }
22
17
@@ -50,7 +45,7 @@ def work():
50
45
@pytest .mark .trio
51
46
async def test_policy (self , loop , config ):
52
47
asyncio = config .asyncio
53
- result = {'loop' : 'not set' } # sentinel, different than None
48
+ result = {'loop' : 'not set' } # sentinel, different than None
54
49
55
50
def work ():
56
51
try :
@@ -65,7 +60,6 @@ def work():
65
60
66
61
@pytest .mark .trio
67
62
async def test_run_in_thread (self , config ):
68
- asyncio = config .asyncio
69
63
threading = config .threading
70
64
71
65
class LoopThread (threading .Thread ):
@@ -105,4 +99,3 @@ def func(loop):
105
99
# wait for the other thread's event loop to terminate
106
100
thread .join ()
107
101
assert result == [tid ]
108
-
0 commit comments