Skip to content

Commit

Permalink
chore: make tests forward-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored and abn committed Mar 13, 2024
1 parent 133da2f commit b8de903
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit b8de903

Please sign in to comment.