Skip to content

OrderedDict repr change causes doctest failures #1395

@randomir

Description

@randomir

In Python 3.12, OrderedDict has changed its repr to use regular dictionary formatting instead of pairs of keys and values. See python/cpython#101446 / python/cpython#101661.

As a result, we have a few doctests failing:

File "../env/lib/python3.12/site-packages/dimod/reference/composites/tracking.py", line ?, in default
Failed example:
    sampler.input
Expected:
    OrderedDict([('h', {'a': -1}), ('J', {('a', 'b'): 1}), ('num_reads', 5)])
Got:
    OrderedDict({'h': {'a': -1}, 'J': {('a', 'b'): 1}, 'num_reads': 5})
**********************************************************************
File "../env/lib/python3.12/site-packages/dimod/reference/composites/tracking.py", line ?, in default
Failed example:
    sampler.input
Expected:
    OrderedDict([('Q', {('a', 'b'): 1})])
Got:
    OrderedDict({'Q': {('a', 'b'): 1}})

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions