Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_pipfile_load fails with tomlkit 0.5.5 #9

Closed
PatrikKopkan opened this issue Jul 22, 2019 · 4 comments
Closed

test_pipfile_load fails with tomlkit 0.5.5 #9

PatrikKopkan opened this issue Jul 22, 2019 · 4 comments

Comments

@PatrikKopkan
Copy link

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(<AoT [{'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': True}]>)
E +SourceCollection([{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}])
E Full diff:
E - SourceCollection(<AoT [{'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': True}]>)
E ? ----- ---------------- -
E + SourceCollection([{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}])
E ?

@uranusjr
Copy link
Member

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

@uranusjr
Copy link
Member

Looks like an upstream bug.

@cclauss
Copy link
Contributor

cclauss commented Sep 21, 2022

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

@uranusjr
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants