Skip to content

Commit a29c206

Browse files
authored
CI: xfail strict=True TestClipboard.test_raw_roundtrip in a CI environment (#52020)
1 parent d716d80 commit a29c206

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

pandas/tests/io/test_clipboard.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import os
2-
import subprocess
32
from textwrap import dedent
43

54
import numpy as np
65
import pytest
76

8-
from pandas.compat import (
9-
is_ci_environment,
10-
is_platform_linux,
11-
is_platform_mac,
12-
)
7+
from pandas.compat import is_ci_environment
138
from pandas.errors import (
149
PyperclipException,
1510
PyperclipWindowsException,
@@ -406,17 +401,14 @@ def test_round_trip_valid_encodings(self, enc, df):
406401
@pytest.mark.single_cpu
407402
@pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."])
408403
@pytest.mark.xfail(
409-
os.environ.get("DISPLAY") is None and not is_platform_mac(),
410-
reason="Cannot be runed if a headless system is not put in place with Xvfb",
411-
strict=True,
404+
os.environ.get("DISPLAY") is None or is_ci_environment(),
405+
reason="Cannot pass if a headless system is not put in place with Xvfb",
406+
strict=not is_ci_environment(), # Flaky failures in the CI
412407
)
413408
def test_raw_roundtrip(self, data):
414409
# PR #25040 wide unicode wasn't copied correctly on PY3 on windows
415410
clipboard_set(data)
416411
assert data == clipboard_get()
417-
if is_ci_environment() and is_platform_linux():
418-
# Clipboard can sometimes keep previous param causing flaky CI failures
419-
subprocess.run(["xsel", "--delete", "--clipboard"], check=True)
420412

421413
@pytest.mark.parametrize("engine", ["c", "python"])
422414
def test_read_clipboard_dtype_backend(

0 commit comments

Comments
 (0)