I have a failing doctest trying to test 3.15.0b1; the tests work for versions <= 3.15.0a8. I think this is an issue with pprint, but need advice on how to get over the problem test.
>>> from pprint import pprint as pp
>>> pp(sorted(config.items('DEFAULT')))
[('dataSource.name', "'mydata_uat'"),
('dataSource.password', "'drongo'"),
('dataSource.user', "'gordon'")]
>>> pp(sorted(config.items('mychart')))
[('chart.valueAxis.labels.fontName', "'Helvetica'"),
('chart.valueAxis.labels.fontSize', '12'),
('dataSource.name', "'mydata_uat'"),
('dataSource.password', "'drongo'"),
('dataSource.user', "'gordon'"),
('height', '250'),
('someColor', 'red')]
When tests are run the second fails I see this
>>> pp(sorted(config.items('mychart')))
AssertionError: Failed example:
pp(sorted(config.items('mychart')))
Expected:
[('chart.valueAxis.labels.fontName', "'Helvetica'"),
('chart.valueAxis.labels.fontSize', '12'),
('dataSource.name', "'mydata_uat'"),
('dataSource.password', "'drongo'"),
('dataSource.user', "'gordon'"),
('height', '250'),
('someColor', 'red')]
Got:
[
('chart.valueAxis.labels.fontName', "'Helvetica'"),
('chart.valueAxis.labels.fontSize', '12'),
('dataSource.name', "'mydata_uat'"),
('dataSource.password', "'drongo'"),
('dataSource.user', "'gordon'"),
('height', '250'),
('someColor', 'red'),
]
testing shows that between 3.15.0a8 and 3.15.0b1 the pprint output did change.
Is there some way to get a readable test that works across the a8 - b1 change or do I have to switch to using pp(calculated) == pp(literal) as the test and ask for a True value?