Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
ff35c28a
Commit
ff35c28a
authored
May 26, 2022
by
Randy Döring
Committed by
Arun Babu Neelicattu
May 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(solver): increase test coverage by searching for copies instead of the same instance
parent
ab2a0e8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
tests/mixology/version_solver/test_dependency_cache.py
+9
-4
No files found.
tests/mixology/version_solver/test_dependency_cache.py
View file @
ff35c28a
from
__future__
import
annotations
from
copy
import
deepcopy
from
typing
import
TYPE_CHECKING
from
poetry.factory
import
Factory
...
...
@@ -34,8 +35,10 @@ def test_solver_dependency_cache_respects_source_type(
cache
.
search_for
(
dependency_git
)
assert
not
cache
.
search_for
.
cache_info
()
.
hits
packages_pypi
=
cache
.
search_for
(
dependency_pypi
)
packages_git
=
cache
.
search_for
(
dependency_git
)
# increase test coverage by searching for copies
# (when searching for the exact same object, __eq__ is never called)
packages_pypi
=
cache
.
search_for
(
deepcopy
(
dependency_pypi
))
packages_git
=
cache
.
search_for
(
deepcopy
(
dependency_git
))
assert
cache
.
search_for
.
cache_info
()
.
hits
==
2
assert
cache
.
search_for
.
cache_info
()
.
currsize
==
2
...
...
@@ -90,8 +93,10 @@ def test_solver_dependency_cache_respects_subdirectories(
cache
.
search_for
(
dependency_one_copy
)
assert
not
cache
.
search_for
.
cache_info
()
.
hits
packages_one
=
cache
.
search_for
(
dependency_one
)
packages_one_copy
=
cache
.
search_for
(
dependency_one_copy
)
# increase test coverage by searching for copies
# (when searching for the exact same object, __eq__ is never called)
packages_one
=
cache
.
search_for
(
deepcopy
(
dependency_one
))
packages_one_copy
=
cache
.
search_for
(
deepcopy
(
dependency_one_copy
))
assert
cache
.
search_for
.
cache_info
()
.
hits
==
2
assert
cache
.
search_for
.
cache_info
()
.
currsize
==
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment