From 0ce09e6516dada92823dbcc6e78a74c48800910d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Sat, 28 Jan 2023 10:11:28 +0100 Subject: [PATCH] tests: make tests forward compatible --- tests/test_exporter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_exporter.py b/tests/test_exporter.py index a0afd85..48a9d2a 100644 --- a/tests/test_exporter.py +++ b/tests/test_exporter.py @@ -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} @@ -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(