@@ -32,39 +32,39 @@ def get_activity_fd(self) -> t.Optional[FileDescriptor]:
32
32
33
33
class TestEpoller (TrioTestCase ):
34
34
async def test_local (self ) -> None :
35
- await do_async_things (self , self .thr .epoller , self .thr )
35
+ await do_async_things (self , self .process .epoller , self .process )
36
36
37
37
async def test_multi (self ) -> None :
38
- await do_async_things (self , self .thr .epoller , self .thr , 0 )
38
+ await do_async_things (self , self .process .epoller , self .process , 0 )
39
39
async with trio .open_nursery () as nursery :
40
40
for i in range (1 , 6 ):
41
- nursery .start_soon (do_async_things , self , self .thr .epoller , self .thr , i )
41
+ nursery .start_soon (do_async_things , self , self .process .epoller , self .process , i )
42
42
43
43
async def test_process_multi (self ) -> None :
44
- process = await self .thr .fork ()
44
+ process = await self .process .fork ()
45
45
await do_async_things (self , process .epoller , process , 0 )
46
46
async with trio .open_nursery () as nursery :
47
47
for i in range (1 , 6 ):
48
48
nursery .start_soon (do_async_things , self , process .epoller , process , i )
49
49
50
50
async def test_process_root_epoller (self ) -> None :
51
- process = await self .thr .fork ()
51
+ process = await self .process .fork ()
52
52
epoller = await Epoller .make_root (process .ram , process .task )
53
53
await do_async_things (self , epoller , process )
54
54
55
55
async def test_afd_with_handle (self ):
56
- pipe = await self .thr .pipe ()
57
- afd = await self .thr .make_afd (pipe .write , set_nonblock = True )
56
+ pipe = await self .process .pipe ()
57
+ afd = await self .process .make_afd (pipe .write , set_nonblock = True )
58
58
new_afd = afd .with_handle (pipe .write )
59
59
await new_afd .write_all_bytes (b'foo' )
60
60
61
61
async def test_delayed_eagain (self ):
62
- pipe = await self .thr .pipe ()
63
- process = await self .thr .fork ()
62
+ pipe = await self .process .pipe ()
63
+ process = await self .process .fork ()
64
64
async_pipe_rfd = await process .make_afd (process .inherit_fd (pipe .read ), set_nonblock = True )
65
65
# write in parent, read in child
66
66
input_data = b'hello'
67
- buf_to_write : Pointer [bytes ] = await self .thr .ptr (input_data )
67
+ buf_to_write : Pointer [bytes ] = await self .process .ptr (input_data )
68
68
buf_to_write , _ = await pipe .write .write (buf_to_write )
69
69
self .assertEqual (await async_pipe_rfd .read_some_bytes (), input_data )
70
70
buf = await process .malloc (bytes , 4096 )
@@ -89,9 +89,9 @@ async def race_eagain():
89
89
90
90
async def test_wrong_op_on_pipe (self ):
91
91
"Reading or writing to the wrong side of a pipe fails immediately with an error"
92
- pipe = await self .thr .pipe ()
93
- async_pipe_wfd = await self .thr .make_afd (pipe .write , set_nonblock = True )
94
- async_pipe_rfd = await self .thr .make_afd (pipe .read , set_nonblock = True )
92
+ pipe = await self .process .pipe ()
93
+ async_pipe_wfd = await self .process .make_afd (pipe .write , set_nonblock = True )
94
+ async_pipe_rfd = await self .process .make_afd (pipe .read , set_nonblock = True )
95
95
# we actually are defined to get EBADF in this case, which is
96
96
# a bit of a worrying error, but whatever
97
97
with self .assertRaises (OSError ) as cm :
0 commit comments