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

fix: failing test due to hardcoded string in test #143

Merged
merged 1 commit into from
Sep 5, 2023
Merged

fix: failing test due to hardcoded string in test #143

merged 1 commit into from
Sep 5, 2023

Conversation

grawlinson
Copy link
Contributor

@grawlinson grawlinson commented Sep 4, 2023

A test (test__enable_in_doc__empty()) fails due to hardcoded strings in tests/test_unit.py becoming out of sync with changes in pyproject.toml.

Full output of failing test:

=================================== FAILURES ===================================
__________________________ test__enable_in_doc__empty __________________________

    def test__enable_in_doc__empty():
        doc = tomlkit.parse("")
        updated = cli._enable_in_doc(doc)
        assert updated[cli.Key.tool][cli.Key.pdv][cli.Key.enable] is True
        assert updated[cli.Key.build_system][cli.Key.requires] == cli._DEFAULT_REQUIRES
        assert updated[cli.Key.build_system][cli.Key.build_backend] == cli._DEFAULT_BUILD_BACKEND
>       assert (
            tomlkit.dumps(updated)
            == textwrap.dedent(
                """
                    [tool.poetry-dynamic-versioning]
                    enable = true

                    [build-system]
                    requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
                    build-backend = "poetry_dynamic_versioning.backend"
                """
            ).lstrip()
        )
E       assert '[tool.poetry...ng.backend"\n' == '[tool.poetry...ng.backend"\n'
E           [tool.poetry-dynamic-versioning]
E           enable = true
E
E           [build-system]
E         - requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
E         + requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
E         ?                                                             ++++++++++++++
E           build-backend = "poetry_dynamic_versioning.backend"

tests/test_unit.py:119: AssertionError
=========================== short test summary info ============================
FAILED tests/test_unit.py::test__enable_in_doc__empty - assert '[tool.poetry....
========================= 1 failed, 20 passed in 0.27s =========================

A test (test__enable_in_doc__empty()) fails due to hardcoded strings in
`tests/test_unit.py` becoming out of sync with changes in
`pyproject.toml`.

Full output of failing test:

```
=================================== FAILURES ===================================
__________________________ test__enable_in_doc__empty __________________________

    def test__enable_in_doc__empty():
        doc = tomlkit.parse("")
        updated = cli._enable_in_doc(doc)
        assert updated[cli.Key.tool][cli.Key.pdv][cli.Key.enable] is True
        assert updated[cli.Key.build_system][cli.Key.requires] == cli._DEFAULT_REQUIRES
        assert updated[cli.Key.build_system][cli.Key.build_backend] == cli._DEFAULT_BUILD_BACKEND
>       assert (
            tomlkit.dumps(updated)
            == textwrap.dedent(
                """
                    [tool.poetry-dynamic-versioning]
                    enable = true

                    [build-system]
                    requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
                    build-backend = "poetry_dynamic_versioning.backend"
                """
            ).lstrip()
        )
E       assert '[tool.poetry...ng.backend"\n' == '[tool.poetry...ng.backend"\n'
E           [tool.poetry-dynamic-versioning]
E           enable = true
E
E           [build-system]
E         - requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
E         + requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
E         ?                                                             ++++++++++++++
E           build-backend = "poetry_dynamic_versioning.backend"

tests/test_unit.py:119: AssertionError
=========================== short test summary info ============================
FAILED tests/test_unit.py::test__enable_in_doc__empty - assert '[tool.poetry....
========================= 1 failed, 20 passed in 0.27s =========================
```
Copy link
Owner

@mtkennerly mtkennerly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mtkennerly mtkennerly merged commit f5c8d05 into mtkennerly:master Sep 5, 2023
25 checks passed
@mtkennerly mtkennerly added the bug Something isn't working label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants