Skip to content

Commit

Permalink
Move purging finder cache to the get resolver fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
jbylund committed Oct 21, 2021
1 parent 68a80d8 commit 366b5d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/unit/resolution_resolvelib/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def resolver(preparer: RequirementPreparer, finder: PackageFinder) -> Resolver:
force_reinstall=False,
upgrade_strategy="to-satisfy-only",
)
finder.find_all_candidates.cache_clear()
return resolver


Expand Down Expand Up @@ -252,8 +253,6 @@ def test_new_resolver_topological_weights(


def test_resolver_cache_population(resolver: Resolver) -> None:
resolver._finder.find_all_candidates.cache_clear()

def get_findall_cacheinfo() -> Dict[str, int]:
cacheinfo = resolver._finder.find_all_candidates.cache_info()
return {k: getattr(cacheinfo, k) for k in ["currsize", "hits", "misses"]}
Expand Down

0 comments on commit 366b5d1

Please sign in to comment.