gh-98512: Add more tests for ValuesView (#98515)

This commit is contained in:
Nikita Sobolev 2022-11-03 05:10:42 +03:00 committed by GitHub
parent 1fd20d0b57
commit 29e027c3e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -1602,6 +1602,7 @@ class TestCollectionABCs(ABCTestCase):
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 @@ class TestCollectionABCs(ABCTestCase):
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)

View file

@ -338,6 +338,9 @@ class DictSetTest(unittest.TestCase):
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)