Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
f397e1fd
Commit
f397e1fd
authored
Dec 29, 2016
by
Rami Ali
Committed by
Damien George
Dec 29, 2016
Browse files
tests/thread: Improve modthread.c test coverage.
parent
c15ebf7c
Changes
4
Hide whitespace changes
Inline
Side-by-side
tests/run-tests
View file @
f397e1fd
...
...
@@ -51,7 +51,7 @@ def convert_regex_escapes(line):
def
run_micropython
(
pyb
,
args
,
test_file
):
special_tests
=
(
'micropython/meminfo.py'
,
'basics/bytes_compare3.py'
)
special_tests
=
(
'micropython/meminfo.py'
,
'basics/bytes_compare3.py'
,
'thread/thread_exc2.py'
)
is_special
=
False
if
pyb
is
None
:
# run on PC
...
...
tests/thread/thread_exc2.py
0 → 100644
View file @
f397e1fd
# test raising exception within thread which is not caught
import
utime
import
_thread
def
thread_entry
():
raise
ValueError
_thread
.
start_new_thread
(
thread_entry
,
())
utime
.
sleep
(
1
)
print
(
'done'
)
tests/thread/thread_exc2.py.exp
0 → 100644
View file @
f397e1fd
Unhandled exception in thread started by <function thread_entry at 0x\[0-9a-f\]\+>
Traceback (most recent call last):
File "thread/thread_exc2.py", line 6, in thread_entry
ValueError:
done
tests/thread/thread_start2.py
View file @
f397e1fd
...
...
@@ -16,4 +16,11 @@ _thread.start_new_thread(thread_entry, (10, 20), {'a2': 0, 'a3': 1})
# wait for thread to finish
time
.
sleep
(
1
)
# incorrect argument where dictionary is needed for keyword args
try
:
_thread
.
start_new_thread
(
thread_entry
,
(),
())
except
TypeError
:
print
(
'TypeError'
)
print
(
'done'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment