<commit_before># -*- coding: utf-8 -*-
import pytest
from riprova import ErrorWhitelist, NotRetriableError


def test_error_whitelist():
    whitelist = ErrorWhitelist()
    assert type(ErrorWhitelist.WHITELIST) is set

    assert len(whitelist._whitelist) > 4
    assert type(whitelist._whitelist) is set
    assert whitelist._whitelist is not ErrorWhitelist.WHITELIST

    # Test setter
    whitelist.errors = (Exception, RuntimeError)

    # Test getter
    assert whitelist.errors == set([Exception, RuntimeError])

    # Test add()
    whitelist.add(TimeoutError, SystemExit)
    assert whitelist.errors == set([Exception, RuntimeError,
                                    TimeoutError, SystemExit])<commit_msg>fix(tests): use valid exception for Python 2.7<commit_after># -*- coding: utf-8 -*-
import pytest
from riprova import ErrorWhitelist, NotRetriableError


def test_error_whitelist():
    whitelist = ErrorWhitelist()
    assert type(ErrorWhitelist.WHITELIST) is set

    assert len(whitelist._whitelist) > 4
    assert type(whitelist._whitelist) is set
    assert whitelist._whitelist is not ErrorWhitelist.WHITELIST

    # Test setter
    whitelist.errors = (Exception, RuntimeError)

    # Test getter
    assert whitelist.errors == set([Exception, RuntimeError])

    # Test add()
    whitelist.add(BaseException, SystemExit)
    assert whitelist.errors == set([Exception, RuntimeError,
                                    BaseException, SystemExit])
{'fraction_non_alphanumeric': 0.08861622358554874, 'fraction_numerical': 0.00408997955010225, 'mean_word_length': 3.369047619047619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6577766', 'n_tokens_mistral': 454, 'n_tokens_neox': 425, 'n_words': 107}