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

(cherry picked from commit 29e027c3e6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2022-11-02 19:33:01 -07:00 committed by GitHub
parent b9e621b9f4
commit 27dc6dbafe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -1580,6 +1580,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:
@ -1843,6 +1844,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

@ -320,6 +320,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)