Skip to content

Commit 754a8e4

Browse files
authored
Remove return from finally block (#60)
* 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 * Fix setuptools-scm configuration
2 parents 90a346f + a8f09eb commit 754a8e4

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-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
+++++++++++++++++++

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ requires = [
55
]
66
build-backend = "setuptools.build_meta"
77

8+
[tool.setuptools_scm]
9+
810
[tool.pytest.ini_options]
911
testpaths = ["tests"]
1012
addopts = "-r a"

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)