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

chore: make tests forward-compatible #264

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,15 @@ def _factory(

poetry = Factory().create_poetry(project_dir)

locker = TestLocker(poetry.locker.lock, poetry.locker._local_config)
try:
# with https://github.com/python-poetry/poetry/pull/9133
locker = TestLocker(
poetry.locker.lock,
poetry.locker._pyproject_data, # type: ignore[attr-defined]
)
except AttributeError:
# before https://github.com/python-poetry/poetry/pull/9133
locker = TestLocker(poetry.locker.lock, poetry.locker._local_config)
locker.write()

poetry.set_locker(locker)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ def test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_so
assert content == expected


def test_exporter_exports_requirements_txt_with_default_and_secondary_sources(
def test_exporter_exports_requirements_txt_with_two_primary_sources(
tmp_path: Path, poetry: Poetry
) -> None:
poetry.pool.remove_repository("PyPI")
Expand Down
Loading