Skip to content
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):
Comment thread
uniocto marked this conversation as resolved.
Outdated
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):
Comment thread
uniocto marked this conversation as resolved.
Outdated
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