@@ -33,14 +33,6 @@ def test():
33
33
pooled_name = concurrent .futures .wait ([test ()])
34
34
self .assertNotEqual (pooled_name , threading .current_thread ().name )
35
35
36
- def test_thread_pooled_default_a (self ):
37
- @threaded .threadpooled
38
- async def test ():
39
- return threading .current_thread ().name
40
-
41
- pooled_name = concurrent .futures .wait ([test ()])
42
- self .assertNotEqual (pooled_name , threading .current_thread ().name )
43
-
44
36
def test_thread_pooled_construct (self ):
45
37
@threaded .threadpooled ()
46
38
@asyncio .coroutine
@@ -50,14 +42,6 @@ def test():
50
42
pooled_name = concurrent .futures .wait ([test ()])
51
43
self .assertNotEqual (pooled_name , threading .current_thread ().name )
52
44
53
- def test_thread_pooled_construct_a (self ):
54
- @threaded .threadpooled ()
55
- async def test ():
56
- return threading .current_thread ().name
57
-
58
- pooled_name = concurrent .futures .wait ([test ()])
59
- self .assertNotEqual (pooled_name , threading .current_thread ().name )
60
-
61
45
def test_thread_pooled_loop (self ):
62
46
loop = asyncio .get_event_loop ()
63
47
@@ -69,16 +53,6 @@ def test():
69
53
pooled_name = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
70
54
self .assertNotEqual (pooled_name , threading .current_thread ().name )
71
55
72
- def test_thread_pooled_loop_a (self ):
73
- loop = asyncio .get_event_loop ()
74
-
75
- @threaded .threadpooled (loop_getter = loop )
76
- async def test ():
77
- return threading .current_thread ().name
78
-
79
- pooled_name = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
80
- self .assertNotEqual (pooled_name , threading .current_thread ().name )
81
-
82
56
def test_thread_pooled_loop_getter (self ):
83
57
loop = asyncio .get_event_loop ()
84
58
@@ -90,16 +64,6 @@ def test():
90
64
pooled_name = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
91
65
self .assertNotEqual (pooled_name , threading .current_thread ().name )
92
66
93
- def test_thread_pooled_loop_getter_a (self ):
94
- loop = asyncio .get_event_loop ()
95
-
96
- @threaded .threadpooled (loop_getter = asyncio .get_event_loop )
97
- async def test ():
98
- return threading .current_thread ().name
99
-
100
- pooled_name = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
101
- self .assertNotEqual (pooled_name , threading .current_thread ().name )
102
-
103
67
def test_thread_pooled_loop_getter_context (self ):
104
68
loop = asyncio .get_event_loop ()
105
69
@@ -119,24 +83,6 @@ def test(*args, **kwargs):
119
83
)
120
84
self .assertNotEqual (pooled_name , threading .current_thread ().name )
121
85
122
- def test_thread_pooled_loop_getter_context_a (self ):
123
- loop = asyncio .get_event_loop ()
124
-
125
- def loop_getter (target ):
126
- return target
127
-
128
- @threaded .threadpooled (
129
- loop_getter = loop_getter ,
130
- loop_getter_need_context = True
131
- )
132
- async def test (* args , ** kwargs ):
133
- return threading .current_thread ().name
134
-
135
- pooled_name = loop .run_until_complete (
136
- asyncio .wait_for (test (loop ), 1 )
137
- )
138
- self .assertNotEqual (pooled_name , threading .current_thread ().name )
139
-
140
86
141
87
class TestAsyncIOTask (unittest .TestCase ):
142
88
def test_default (self ):
@@ -149,26 +95,12 @@ def test():
149
95
res = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
150
96
self .assertEqual (res , 'test' )
151
97
152
- def test_default_a (self ):
153
- @threaded .asynciotask
154
- async def test ():
155
- return 'test'
156
-
157
- loop = asyncio .get_event_loop ()
158
- res = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
159
- self .assertEqual (res , 'test' )
160
-
161
98
def test_construct (self ):
162
99
@threaded .asynciotask ()
163
100
@asyncio .coroutine
164
101
def test ():
165
102
return 'test'
166
103
167
- def test_construct_a (self ):
168
- @threaded .asynciotask ()
169
- async def test ():
170
- return 'test'
171
-
172
104
loop = asyncio .get_event_loop ()
173
105
res = loop .run_until_complete (asyncio .wait_for (test (), 1 ))
174
106
self .assertEqual (res , 'test' )
0 commit comments