tests/basics: Add tests to improve coverage of py/objdeque.c.
This commit is contained in:
parent
4668ec801e
commit
8f9b113be2
@ -45,3 +45,18 @@ try:
|
||||
d.popleft()
|
||||
except IndexError:
|
||||
print("IndexError")
|
||||
|
||||
# Case where get index wraps around when appending to full deque
|
||||
d = deque((), 2)
|
||||
d.append(1)
|
||||
d.append(2)
|
||||
d.append(3)
|
||||
d.append(4)
|
||||
d.append(5)
|
||||
print(d.popleft(), d.popleft())
|
||||
|
||||
# Unsupported unary op
|
||||
try:
|
||||
~d
|
||||
except TypeError:
|
||||
print("TypeError")
|
||||
|
@ -13,3 +13,10 @@ print(sys.getsizeof({1: 2}) >= 2)
|
||||
class A:
|
||||
pass
|
||||
print(sys.getsizeof(A()) > 0)
|
||||
|
||||
# Only test deque if we have it
|
||||
try:
|
||||
from ucollections import deque
|
||||
assert sys.getsizeof(deque((), 1)) > 0
|
||||
except ImportError:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user