Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-25872: Add unit tests for linecache and threading#25913
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
21 commits Select commit Hold shift + click to select a range
5143e74 bpo-25872: add test_oserror
uniocto fc1f92d refactor linecache
uniocto fc4df5d add test_multithread_modify_file()
uniocto a977922 refactor test_threading
uniocto 759de2b refactor test_multithread_modify_file_noerror()
uniocto 5666a1d refactor raise_oserror()
uniocto 4513859 Change black box tests and refactoring
uniocto 8376d21 refactor LineCacheInvalidationTests
uniocto 708e348 refactor test_multithread_modify_file_noerror
uniocto f021de2 refactor assertions
uniocto a396fad Update Lib/test/test_linecache.py
uniocto 833c9b9 Update Lib/test/test_linecache.py
uniocto bcc20ab Update Lib/test/test_threading.py
uniocto ba62b83 change __file__ and rm traceback.format_stack
uniocto 420a638 add traceback
uniocto 2c8269b fix type in field name
iritkatriel 8efe040 reduce repetition in setUp
iritkatriel 240eb9a check cache keys directly, not count
iritkatriel f66a050 Merge pull request #2 from iritkatriel/pr25913
uniocto 78897e7 addCleanup to outside of the mofidy_file()
uniocto ac550ef Merge remote-tracking branch 'upstream/main' into fix-issue-25872
uniocto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,7 +4,7 @@ | ||
| import test.support | ||
| from test.support import threading_helper | ||
| from test.support import verbose, cpython_only | ||
| from test.support import verbose, cpython_only, os_helper | ||
| from test.support.import_helper import import_module | ||
| from test.support.script_helper import assert_python_ok, assert_python_failure | ||
| @@ -19,6 +19,7 @@ | ||
| import subprocess | ||
| import signal | ||
| import textwrap | ||
| import traceback | ||
| from unittest import mock | ||
| from test import lock_tests | ||
| @@ -1345,6 +1346,22 @@ def run(self): | ||
| # explicitly break the reference cycle to not leak a dangling thread | ||
| thread.exc = None | ||
| def test_multithread_modify_file_noerror(self): | ||
| # See issue25872 | ||
| def modify_file(): | ||
| with open(os_helper.TESTFN, 'w', encoding='utf-8') as fp: | ||
| fp.write(' ') | ||
iritkatriel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| traceback.format_stack() | ||
| self.addCleanup(os_helper.unlink, os_helper.TESTFN) | ||
| threads = [ | ||
| threading.Thread(target=modify_file) | ||
| for i in range(100) | ||
| ] | ||
| for t in threads: | ||
| t.start() | ||
| t.join() | ||
| class ThreadRunFail(threading.Thread): | ||
| def run(self): | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.