8000 bpo-25872: Add unit tests for linecache and threading by uniocto · Pull Request #25913 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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
merged 21 commits into from
May 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor assertions
  • Loading branch information
uniocto committed May 9, 2021
commit f021de2b942b2adf9790d4e0aa2e587ea7884fea
12 changes: 6 additions & 6 deletions Lib/test/test_linecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,19 @@ def setUp(self):
def test_checkcache_with_oserror(self):
self.assertEqual(3, len(linecache.cache.keys()))
linecache.checkcache(self.deleted_file)
self.assertTrue(2 == len(linecache.cache.keys()) and
self.deleted_file not in linecache.cache.keys())
self.assertEqual(2, len(linecache.cache.keys()))
self.assertNotIn(self.deleted_file, linecache.cache.keys())

def test_checkcache_with_not_match_size_or_timestamp(self):
self.assertEqual(3, len(linecache.cache.keys()))
linecache.checkcache(self.modified_file)
self.assertTrue(2 == len(linecache.cache.keys()) and
self.modified_file not in linecache.cache.keys())
self.assertEqual(2, len(linecache.cache.keys()))
self.assertNotIn(self.modified_file, linecache.cache.keys())

def test_checkcache_with_no_parameters(self):
def test_checkcache_with_no_parameter(self):
self.assertEqual(3, len(linecache.cache.keys()))
linecache.checkcache()
self.assertTrue([self.unchange_file] == list(linecache.cache.keys()))
self.assertEqual([self.unchange_file], list(linecache.cache.keys()))


if __name__ == "__main__":
Expand Down
0