Skip to content

Commit

Permalink
Adjust tests for parsing whitespaces and inline comments in requireme…
Browse files Browse the repository at this point in the history
…nts file line
  • Loading branch information
realshouzy committed Jun 11, 2024
1 parent 1652fe6 commit c2875d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/pip_purge_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,14 @@ def test_freeze_packages(tmp_path: Path) -> None:
("package_b <2.0,>=1.4", "package_b"),
("package_c <2.0,>=1.4;python_version<'3.11'", "package_c"),
("package_d!=3.0", "package_d"),
(" package_e#comment", "package_e"),
("package_e # comment", "package_e"),
(" package_f ", "package_f"),
],
)
def test_parse_requirements_file_line(requirement: str, package_name: str) -> None:
def test_extract_package_from_requirements_file_line(
requirement: str,
package_name: str,
) -> None:
assert (
pip_purge._extract_package_from_requirements_file_line(requirement)
== package_name
Expand Down

0 comments on commit c2875d2

Please sign in to comment.