Skip to content

CI: xfail strict=True TestClipboard.test_raw_roundtrip in a CI environment #52020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions pandas/tests/io/test_clipboard.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import os
import subprocess
from textwrap import dedent

import numpy as np
import pytest

from pandas.compat import (
is_ci_environment,
is_platform_linux,
is_platform_mac,
)
from pandas.compat import is_ci_environment
from pandas.errors import (
PyperclipException,
PyperclipWindowsException,
Expand Down Expand Up @@ -406,17 +401,14 @@ def test_round_trip_valid_encodings(self, enc, df):
@pytest.mark.single_cpu
@pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."])
@pytest.mark.xfail(
os.environ.get("DISPLAY") is None and not is_platform_mac(),
reason="Cannot be runed if a headless system is not put in place with Xvfb",
strict=True,
os.environ.get("DISPLAY") is None or is_ci_environment(),
reason="Cannot pass if a headless system is not put in place with Xvfb",
strict=not is_ci_environment(), # Flaky failures in the CI
)
def test_raw_roundtrip(self, data):
# PR #25040 wide unicode wasn't copied correctly on PY3 on windows
clipboard_set(data)
assert data == clipboard_get()
if is_ci_environment() and is_platform_linux():
# Clipboard can sometimes keep previous param causing flaky CI failures
subprocess.run(["xsel", "--delete", "--clipboard"], check=True)

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