mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
gh-98512: Add more tests for ValuesView (#98515)
This commit is contained in:
parent
1fd20d0b57
commit
29e027c3e6
2 changed files with 6 additions and 0 deletions
|
|
@ -1602,6 +1602,7 @@ def __len__(self):
|
|||
containers = [
|
||||
seq,
|
||||
ItemsView({1: nan, 2: obj}),
|
||||
KeysView({1: nan, 2: obj}),
|
||||
ValuesView({1: nan, 2: obj})
|
||||
]
|
||||
for container in containers:
|
||||
|
|
@ -1865,6 +1866,8 @@ def test_MutableMapping_subclass(self):
|
|||
mymap['red'] = 5
|
||||
self.assertIsInstance(mymap.keys(), Set)
|
||||
self.assertIsInstance(mymap.keys(), KeysView)
|
||||
self.assertIsInstance(mymap.values(), Collection)
|
||||
self.assertIsInstance(mymap.values(), ValuesView)
|
||||
self.assertIsInstance(mymap.items(), Set)
|
||||
self.assertIsInstance(mymap.items(), ItemsView)
|
||||
|
||||
|
|
|
|||
|
|
@ -338,6 +338,9 @@ def test_abc_registry(self):
|
|||
self.assertIsInstance(d.values(), collections.abc.ValuesView)
|
||||
self.assertIsInstance(d.values(), collections.abc.MappingView)
|
||||
self.assertIsInstance(d.values(), collections.abc.Sized)
|
||||
self.assertIsInstance(d.values(), collections.abc.Collection)
|
||||
self.assertIsInstance(d.values(), collections.abc.Iterable)
|
||||
self.assertIsInstance(d.values(), collections.abc.Container)
|
||||
|
||||
self.assertIsInstance(d.items(), collections.abc.ItemsView)
|
||||
self.assertIsInstance(d.items(), collections.abc.MappingView)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue