New submission from Vajrasky Kok:
This is the test.
def test_keys(self):
d = {}
self.assertEqual(set(d.keys()), set())
d = {'a': 1, 'b': 2}
k = d.keys()
self.assertIn('a', d)
self.assertIn('b', d)
self.assertRaises(TypeError, d.keys, None)
self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])")
As you can see, the variable k is never used. Attached the patch to give
purpose to variable k.
----------
components: Tests
files: fix_test_dict_unused_variable.patch
keywords: patch
messages: 198957
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Unusued variable in test_keys in Lib/test/test_dict.py
versions: Python 3.4
Added file: http://bugs.python.org/file31958/fix_test_dict_unused_variable.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19166>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com