From c4d2bbad5598c3bad90891e65537ee09ccd45a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Sun, 30 Jan 2022 09:52:20 +0100 Subject: [PATCH] Adapt expectation to improvement in union of markers --- tests/utils/test_exporter.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/utils/test_exporter.py b/tests/utils/test_exporter.py index da7810db1d1..216cf9c6f6b 100644 --- a/tests/utils/test_exporter.py +++ b/tests/utils/test_exporter.py @@ -1,4 +1,5 @@ import sys +import textwrap from pathlib import Path from typing import TYPE_CHECKING @@ -1040,13 +1041,26 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_ with (Path(tmp_dir) / "requirements.txt").open(encoding="utf-8") as f: content = f.read() - expected = """\ -bar==7.8.9 ; platform_system != "Windows" or platform_system == "Windows" -baz==10.11.13 ; platform_system == "Windows" -foo==1.2.3 -""" + expected = ( + # expectation for poetry-core <= 1.1.0a6 + textwrap.dedent( + """\ + bar==7.8.9 ; platform_system != "Windows" or platform_system == "Windows" + baz==10.11.13 ; platform_system == "Windows" + foo==1.2.3 + """ + ), + # expectation for poetry-core > 1.1.0a6 + textwrap.dedent( + """\ + bar==7.8.9 + baz==10.11.13 ; platform_system == "Windows" + foo==1.2.3 + """ + ), + ) - assert expected == content + assert content in expected def test_exporter_can_export_requirements_txt_with_git_packages_and_markers(