Skip to content

Commit e898111

Browse files
committed
Remove return from finally block
This `return` swallows any exceptions that might happen inside the `try/finally` block. While this does seem intentional, there is no reason for `set(item.nodeid ...)` to not work, given `nodeid` is a string. Fix #58
1 parent 90a346f commit e898111

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ UNRELEASED
77
++++++++++
88

99
* Dropped support for EOL Python versions and added support for Python 3.13.
10+
* Fix `#58 <https://github.com/pytest-dev/pytest-random-order/issues/58>`_: ``return`` in a ``finally`` block swallows exceptions and raises a warning in Python 3.14.
1011

1112
v1.1.1 (2024-01-20)
1213
+++++++++++++++++++

random_order/shuffler.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ def get_full_bucket_key(item):
9393

9494

9595
def _get_set_of_item_ids(items):
96-
s = {}
97-
try:
98-
s = set(item.nodeid for item in items)
99-
finally:
100-
return s
96+
return set(item.nodeid for item in items)
10197

10298

10399
def _disable(item, session):

0 commit comments

Comments
 (0)