tests/extmod: Remove asyncio .exp files that match CPython output.

These were added back in commit c4935f3049
because the tests required CPython 3.8, which was quite new at the time.
But CPython 3.8 was released over 4 years ago (October 2019) and the CI
test runners, and developers, have this (or a more recent) CPython version.

Removing the .exp files also helps keep MicroPython semantics the same as
CPython.

The asyncio_fair.py test it adjusted slightly to have more deterministic
timing and output.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-01-23 11:11:25 +11:00
parent 8eb658f654
commit 6bb446b7ff
18 changed files with 5 additions and 204 deletions

View File

@ -1,2 +0,0 @@
42
42

View File

@ -1,4 +0,0 @@
main start
forever start
main done
42

View File

@ -1,24 +0,0 @@
start 0
start 1
start 2
done 0
0 cancels 1
start 0
cancelled 1
1 cancels 0
start 1
done 2
start 2
cancelled 0
0 cancels 1
start 0
cancelled 1
1 cancels 0
start 1
done 2
start 2
cancelled 0
0 cancels 1
cancelled 1
1 cancels 0
done 2

View File

@ -1,8 +0,0 @@
sleep a
sleep b 0
sleep b 1
sleep b 2
cancelled a
done b 0
done b 1
done b 2

View File

@ -1,31 +0,0 @@
True
task start
True
main sleep
task cancel
task start
True
True
True
True
main sleep
task cancel
main wait
main got CancelledError
task start
task done
False
----
task 2
task start
main cancel
main sleep
task cancel
task 2 cancel
----
task 2
task start
main cancel
main sleep
task cancel
task 2 done

View File

@ -1,7 +0,0 @@
main sleep
sleep_task sleep
wait_task wait
main sleep
sleep_task wake
main wait
CancelledError()

View File

@ -1 +0,0 @@
True

View File

@ -1,33 +0,0 @@
False
True
False
----
yield
start 1
start 2
set event
yield
True
end 1
True
end 2
----
yield
start 3
True
end 3
----
clear event
start 4
set event
True
end 4
----
start 5
----
start 6
----
set event
----
TimeoutError
set event

View File

@ -1,16 +0,0 @@
sleep 0
wait 2
sleep 1
wait 3
sleep 0
sleep 1
wait 2
sleep 0
sleep 1
wait 3
sleep 0
sleep 1
wait 2
wait 3
wait 2
wait 3

View File

@ -1,7 +0,0 @@
main start
ValueError 1
main start
task start
ValueError 2
main start
ValueError 3

View File

@ -20,7 +20,7 @@ async def main():
t2 = asyncio.create_task(task(2, 0.1))
t3 = asyncio.create_task(task(3, 0.18))
t4 = asyncio.create_task(task(4, -100))
await asyncio.sleep(0.5)
await asyncio.sleep(0.45) # t2 prints 5 times, t3 prints 3 times
t1.cancel()
t2.cancel()
t3.cancel()

View File

@ -1,13 +0,0 @@
task start 1
task start 2
task work 2
task start 3
task work 3
task start 4
task work 2
task work 3
task work 2
task work 2
task work 3
task work 2
finish

View File

@ -1,4 +1,8 @@
# Test Lock class
#
# This test has a corresponding .exp file because it tests a very specific ordering of
# events when cancelling a task waiting on a lock, and that ordering should not change
# (even though it does match CPython's output).
try:
import asyncio

View File

@ -1,11 +0,0 @@
task 0 start
task 1 start
task 2 start
task 3 start
task 1 cancel
task 2 cancel
task 0 lock_flag False
task 0 done
task 3 lock_flag False
task 3 done
False

View File

@ -1,7 +0,0 @@
run 0
start
sleep
run 1
run 2
task
end

View File

@ -1,6 +0,0 @@
start
task 0
stop
start
task 0
stop

View File

@ -1,9 +0,0 @@
None
True
sleep
custom_handler ValueError(0, 1)
sleep
custom_handler ValueError(1, 2)
custom_handler ValueError(2, 3)
ValueError(3, 4)
done

View File

@ -1,24 +0,0 @@
==========
False
task start
task done
True
True
==========
False
task start
False
task done
True
==========
False
task start
True
ValueError()
True
==========
False
task start
False
ValueError()
True