<commit_before>import unittest
import mock
import pytest
import platform

try:
    from kafka_influxdb.reader import confluent
except ImportError as e:
    if platform.python_implementation() == "PyPy":
        # Confluent-Kafka is not built on PyPy. Ignore.
        confluent = None
    else:
        raise e


class KafkaError(object):
    def __init__(self):
        """
        Error types raised by confluent kafka
        """
        self._PARTITION_EOF = 1


@pytest.mark.skipif(platform.python_implementation() == "PyPy",
                    reason="This reader uses a Python C-Extension for librdkafka, "
                           "which is unsupported on PyPy.")
class TestConfluentKafka(unittest.TestCase):
    def setUp(self):
        self.host = "myhost"
        self.port = 1234
        self.group = "mygroup"
        self.topic = "mytopic"
        self.reconnect_wait_time = 0.01
        self.reader = self.create_reader()

    def create_reader(self):
        reader = confluent.Reader(self.host,
                                  self.port,<commit_msg>Use global pytest marker to skip tests for PyPy<commit_after>import unittest
import mock
import pytest
import platform

pytestmark = pytest.mark.skipif(platform.python_implementation() == "PyPy",
                                reason="This reader uses a Python C-Extension for librdkafka, "
                                       "which is unsupported on PyPy.")

from kafka_influxdb.reader import confluent


class KafkaError(object):
    def __init__(self):
        """
        Error types raised by confluent kafka
        """
        self._PARTITION_EOF = 1


class TestConfluentKafka(unittest.TestCase):
    def setUp(self):
        self.host = "myhost"
        self.port = 1234
        self.group = "mygroup"
        self.topic = "mytopic"
        self.reconnect_wait_time = 0.01
        self.reader = self.create_reader()

    def create_reader(self):
        reader = confluent.Reader(self.host,
                                  self.port,
{'fraction_non_alphanumeric': 0.08519068845963348, 'fraction_numerical': 0.0079247152055473, 'mean_word_length': 2.0934150076569678, 'pattern_counts': {'":': 1, '<': 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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2268546', 'n_tokens_mistral': 599, 'n_tokens_neox': 576, 'n_words': 148}