Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleknap committed Jan 30, 2024
1 parent ae9234d commit b2fbe9b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/dependencies/test_closure.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
_NESTED_STR_DICT = Dict[str, "_NESTED_STR_DICT"]


@pytest.fixture(scope="module")
@pytest.fixture()
def awscli_package():
yield Package(name="awscli")
return Package(name="awscli")


class Package:
Expand Down Expand Up @@ -97,7 +97,7 @@ def _is_bounded_version_requirement(
self, requirement: Requirement
) -> bool:
for specifier in requirement.specifier:
if specifier.operator in ["==", "=<", "<"]:
if specifier.operator in ["==", "<=", "<"]:
return True
return False

Expand Down Expand Up @@ -137,10 +137,13 @@ def test_expected_unbounded_runtime_dependencies(self, awscli_package):
"six", # Transitive dependency from python-dateutil
"wcwidth", # Transitive dependency from prompt-toolkit
}
actual_unbounded_dependencies = set()
all_dependencies = set()
bounded_dependencies = set()
for req, package in awscli_package.runtime_dependencies.walk():
if not self._is_bounded_version_requirement(req):
actual_unbounded_dependencies.add(package.name)
all_dependencies.add(package.name)
if self._is_bounded_version_requirement(req):
bounded_dependencies.add(package.name)
actual_unbounded_dependencies = all_dependencies - bounded_dependencies
assert (
actual_unbounded_dependencies == expected_unbounded_dependencies
), (
Expand Down

0 comments on commit b2fbe9b

Please sign in to comment.