Skip to content

Commit

Permalink
tests: make tests forward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored and neersighted committed Jan 29, 2023
1 parent ead1dfb commit e809b7b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ def test_exporter_doesnt_confuse_repeated_packages(
io = BufferedIO()
exporter.export("requirements.txt", tmp_path, io)

expected = f"""\
expected_legacy = f"""\
celery==5.1.2 ; {MARKER_PY36_ONLY}
celery==5.2.3 ; {MARKER_PY37}
click-didyoumean==0.0.3 ; {MARKER_PY36_PY362}
Expand All @@ -2186,7 +2186,17 @@ def test_exporter_doesnt_confuse_repeated_packages(
click==8.0.3 ; {MARKER_PY37}
"""

assert io.fetch_output() == expected
expected = f"""\
celery==5.1.2 ; {MARKER_PY36_ONLY}
celery==5.2.3 ; {MARKER_PY37}
click-didyoumean==0.0.3 ; {MARKER_PY36_PY362}
click-didyoumean==0.3.0 ; {MARKER_PY362_PY40}
click-plugins==1.1.1 ; {MARKER_PY36}
click==7.1.2 ; {MARKER_PY36_ONLY}
click==8.0.3 ; {MARKER_PY37}
"""

assert io.fetch_output() in {expected, expected_legacy}


def test_exporter_handles_extras_next_to_non_extras(
Expand Down

0 comments on commit e809b7b

Please sign in to comment.