8000 Calling unittest.assertDictEqual for medium-size dictionaries takes too long · Issue #99151 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Calling unittest.assertDictEqual for medium-size dictionaries takes too long #99151
Copy link
Open
@boaza

Description

@boaza

Calling assertDictEqual(d1, d2) / takes forever, even for medium-size dictionaries. To reproduce:

from unittest import TestCase
from random import randint

    def test_assert_dict(self):
        r = 10000000
        num = 10000
        d1 = dict((randint(0, r), randint(0, r)) for _ in range(num))
        d2 = dict((randint(0, r), randint(0, r)) for _ in range(num))
        self.assertDictEqual(d1, d2)

Probably related to issue #63416.

Tested on Python 3.10, Windows 11

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0