Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix traceback construction in tests using threadpool #128

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

fperrin
Copy link
Contributor

@fperrin fperrin commented Jun 6, 2023

Fix issue #127

In a thread, the pseudo-traceback looks like:

_________ test_threadpool __________
FAILURE: check 2 == 3: 1 + 1 is 2, not 3
../../../../usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py:995 in _bootstrap() -> self._bootstrap_inner()
../../../../usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py:1038 in _bootstrap_inner() -> self.run()
../../../../usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py:975 in run() -> self._target(*self._args, **self._kwargs)
../../../../usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py:83 in _worker() -> work_item.run()
../../../../usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py:58 in run() -> result = self.fn(*self.args, **self.kwargs)
examples/test_example_fail_in_thread.py:9 in force_fail() -> do_work(comparison)
examples/test_example_fail_in_thread.py:12 in do_work() -> check.equal(1 + 1, comparison, f"1 + 1 is 2, not {comparison}")

@okken
Copy link
Owner

okken commented Jun 6, 2023

Nice solution to this issue.

@okken okken merged commit 432fd5d into okken:main Jun 6, 2023
@fperrin
Copy link
Contributor Author

fperrin commented Jun 7, 2023

Thank you @okken !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants