mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
Move tests in basic/tests/ up one level preparating to multiple test dirs.
This commit is contained in:
12
tests/basics/dict_pop.py
Normal file
12
tests/basics/dict_pop.py
Normal file
@@ -0,0 +1,12 @@
|
||||
d = {1: 2, 3: 4}
|
||||
print(d.pop(3), d)
|
||||
print(d)
|
||||
print(d.pop(1, 42), d)
|
||||
print(d.pop(1, 42), d)
|
||||
print(d.pop(1, None), d)
|
||||
try:
|
||||
print(d.pop(1), "!!!",)
|
||||
except KeyError:
|
||||
print("Raised KeyError")
|
||||
else:
|
||||
print("Did not rise KeyError!")
|
||||
Reference in New Issue
Block a user