Skip to content

Commit

Permalink
Fix pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Feb 14, 2025
1 parent afdda4e commit 08aae03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions data_structures/queues/circular_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def __len__(self) -> int:
>>> len(cq)
0
>>> cq.enqueue("A") # doctest: +ELLIPSIS
<data_structures.queue.circular_queue.CircularQueue object at ...
<data_structures.queues.circular_queue.CircularQueue object at ...
>>> cq.array
['A', None, None, None, None]
>>> len(cq)
1
"""
Expand Down Expand Up @@ -51,11 +53,13 @@ def enqueue(self, data):
as an index.
>>> cq = CircularQueue(5)
>>> cq.enqueue("A") # doctest: +ELLIPSIS
<data_structures.queue.circular_queue.CircularQueue object at ...
<data_structures.queues.circular_queue.CircularQueue object at ...
>>> (cq.size, cq.first())
(1, 'A')
>>> cq.enqueue("B") # doctest: +ELLIPSIS
<data_structures.queue.circular_queue.CircularQueue object at ...
<data_structures.queues.circular_queue.CircularQueue object at ...
>>> cq.array
['A', 'B', None, None, None]
>>> (cq.size, cq.first())
(2, 'A')
"""
Expand Down
4 changes: 2 additions & 2 deletions data_structures/queues/priority_queue_using_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FixedPriorityQueue:
>>> fpq.dequeue()
Traceback (most recent call last):
...
data_structures.queue.priority_queue_using_list.UnderFlowError: All queues are empty
data_structures.queues.priority_queue_using_list.UnderFlowError: All queues are empty

Check failure on line 62 in data_structures/queues/priority_queue_using_list.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

data_structures/queues/priority_queue_using_list.py:62:89: E501 Line too long (89 > 88)
>>> print(fpq)
Priority 0: []
Priority 1: []
Expand Down Expand Up @@ -141,7 +141,7 @@ class ElementPriorityQueue:
>>> epq.dequeue()
Traceback (most recent call last):
...
data_structures.queue.priority_queue_using_list.UnderFlowError: The queue is empty
data_structures.queues.priority_queue_using_list.UnderFlowError: The queue is empty
>>> print(epq)
[]
"""
Expand Down

0 comments on commit 08aae03

Please sign in to comment.