<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Test writing to stdout and stderr."""

import os
import sys

import pytest

import colorise


def test_stdout_stderr(redirect):
    with redirect('stdout') as stdout:
        colorise.cprint('Hello', fg='red', file=sys.stderr)

        assert stdout.value == ''

    with redirect('stderr') as stderr:
        colorise.cprint('Hello', fg='red', file=sys.stdout)<commit_msg>Skip stdout/stderr test on Windows<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Test writing to stdout and stderr."""

import os
import sys

import pytest

import colorise


@pytest.mark.skip_on_windows
def test_stdout_stderr(redirect):
    with redirect('stdout') as stdout:
        colorise.cprint('Hello', fg='red', file=sys.stderr)

        assert stdout.value == ''

    with redirect('stderr') as stderr:
        colorise.cprint('Hello', fg='red', file=sys.stdout)
{'fraction_non_alphanumeric': 0.1468682505399568, 'fraction_numerical': 0.0021598272138228943, 'mean_word_length': 3.7055837563451774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4525241', 'n_tokens_mistral': 304, 'n_tokens_neox': 297, 'n_words': 76}