Skip to content

Commit

Permalink
Fix bad string interpolation in shutdown log message (#395)
Browse files Browse the repository at this point in the history
* Fix bad string interpolation in shutdown log message

* Add test
  • Loading branch information
mdickinson committed Jul 12, 2021
1 parent 6b1967a commit daaa03c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion traits_futures/tests/traits_executor_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_shutdown_waits_for_background_tasks(self):
def test_shutdown_timeout(self):
start_time = time.monotonic()
with self.long_running_task(self.executor):
with self.assertRaises(RuntimeError):
with self.assertRaisesRegex(RuntimeError, "1 tasks still running"):
self.executor.shutdown(timeout=0.1)

actual_timeout = time.monotonic() - start_time
Expand Down
2 changes: 1 addition & 1 deletion traits_futures/traits_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def shutdown(self, *, timeout=None):
# Re-raise with a more user-friendly error message.
raise RuntimeError(
"Shutdown timed out; "
"f{len(self._wrappers)} tasks still running"
f"{len(self._wrappers)} tasks still running"
) from exc

self._complete_stop()
Expand Down

0 comments on commit daaa03c

Please sign in to comment.