sarugaku / plette

Structured Pipfile and Pipfile.lock models.
ISC License
7 stars 7 forks source link

test_pipfile_load fails with tomlkit 0.5.5 #9

Closed PatrikKopkan closed 1 year ago

PatrikKopkan commented 4 years ago
In tomlkit 0.5.3 the test compares two lists. In 0.5.5 compares list and aot object tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_pipfile_load0') def test_pipfile_load(tmpdir): fi = tmpdir.join("Pipfile.in") fi.write(textwrap.dedent(""" [packages] flask = { version = "*" } jinja2 = '*' # A comment. """)) p = Pipfile.load(fi) > assert p["source"] == SourceCollection([ { 'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi', }, ]) E AssertionError: assert SourceCollect...ssl': True}]>) == SourceCollecti...me': 'pypi'}]) E -SourceCollection() E +SourceCollection([{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}]) E Full diff: E - SourceCollection() E ? ----- ---------------- - E + SourceCollection([{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}]) E ?
uranusjr commented 4 years ago

AoT (array of tables) should compare correctly to list (it is a list subclass). The problem seems more subtle than it appears.

uranusjr commented 4 years ago

Looks like an upstream bug.

cclauss commented 1 year ago

Is this still an issue with the current version of https://pypi.org/project/tomlkit ?

uranusjr commented 1 year ago

Given the CI does not fail now (running against tomlkit 0.11.4) I’m assuming this is fixed.