From b4e397ec0abfb8423f7c73e2a2f3dd1f19ced71e Mon Sep 17 00:00:00 2001 From: adrien pacifico Date: Mon, 12 Sep 2022 21:20:57 +0000 Subject: [PATCH 1/4] change test such that it passes in headless mode (instead of xpass), and xpass in non-headless mode (instead of error) --- pandas/tests/io/test_clipboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index db85cb416145f..13036974adfe6 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -1,4 +1,5 @@ from textwrap import dedent +import os import numpy as np import pytest @@ -391,9 +392,9 @@ def test_round_trip_valid_encodings(self, enc, df): @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."]) @pytest.mark.xfail( - reason="Flaky test in multi-process CI environment: GH 44584", - raises=AssertionError, - strict=False, + os.environ.get('DISPLAY') is None, + reason="Cannot be runned if a headless system is not put in place with ", + strict=True, ) def test_raw_roundtrip(self, data): # PR #25040 wide unicode wasn't copied correctly on PY3 on windows From c1abc669bd45cb53aed8506e1dcc75a5fedfc2dc Mon Sep 17 00:00:00 2001 From: adrien pacifico Date: Mon, 12 Sep 2022 21:59:48 +0000 Subject: [PATCH 2/4] linting --- pandas/tests/io/test_clipboard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index 13036974adfe6..b8f0f1c46ba15 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -1,5 +1,5 @@ -from textwrap import dedent import os +from textwrap import dedent import numpy as np import pytest @@ -392,8 +392,8 @@ def test_round_trip_valid_encodings(self, enc, df): @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."]) @pytest.mark.xfail( - os.environ.get('DISPLAY') is None, - reason="Cannot be runned if a headless system is not put in place with ", + os.environ.get("DISPLAY") is None, + reason="Cannot be runed if a headless system is not put in place with Xvfb", strict=True, ) def test_raw_roundtrip(self, data): From 932dad55d66db2a523ed109eb1ae880d44bffe60 Mon Sep 17 00:00:00 2001 From: adrien pacifico Date: Mon, 12 Sep 2022 22:08:56 +0000 Subject: [PATCH 3/4] add single_cpu mark --- pandas/tests/io/test_clipboard.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index b8f0f1c46ba15..01ea663359f42 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -391,6 +391,7 @@ def test_round_trip_valid_encodings(self, enc, df): self.check_round_trip_frame(df, encoding=enc) @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."]) + @pytest.mark.single_cpu @pytest.mark.xfail( os.environ.get("DISPLAY") is None, reason="Cannot be runed if a headless system is not put in place with Xvfb", From 25b5527934f04d5e97341b662e4bc9d71c615424 Mon Sep 17 00:00:00 2001 From: adrien pacifico Date: Mon, 12 Sep 2022 22:48:19 +0000 Subject: [PATCH 4/4] correct the odorerr of pytest.mark --- pandas/tests/io/test_clipboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index 01ea663359f42..d76b731ba43f9 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -390,8 +390,8 @@ def test_invalid_encoding(self, df): def test_round_trip_valid_encodings(self, enc, df): self.check_round_trip_frame(df, encoding=enc) - @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."]) @pytest.mark.single_cpu + @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."]) @pytest.mark.xfail( os.environ.get("DISPLAY") is None, reason="Cannot be runed if a headless system is not put in place with Xvfb",