<commit_before>import pytest
from django_performance_testing.core import LimitViolationError


def test_required_arguments_are_limit_actual_name_and_context():
    with pytest.raises(TypeError):
        LimitViolationError(
            limit=3, name='foo', context=None)  # missing actual
    with pytest.raises(TypeError):
        LimitViolationError(
            actual=3, name='foo', context=None)  # missing limit
    with pytest.raises(TypeError):
        LimitViolationError(
            actual=2, name='foo', limit=0)  # missing context
    with pytest.raises(TypeError):
        LimitViolationError(
            actual=2, limit=0, context={})  # missing name
    lve = LimitViolationError(
        limit=1, actual=2, name='foo', context={'foo': 'bar'})
    assert lve is not None
    assert lve.limit == 1
    assert lve.actual == 2
    assert lve.context == {'foo': 'bar'}
    assert lve.name == 'foo'
<commit_msg>simplify test of checking arguments<commit_after>import pytest
from django_performance_testing.core import LimitViolationError


def test_required_arguments():
    code = LimitViolationError.__init__.__code__
    assert ('self', 'name', 'limit', 'actual', 'context', 'tb') == \
        code.co_varnames[:code.co_argcount]
    lve = LimitViolationError(
        limit=1, actual=2, name='foo', context={'foo': 'bar'})
    assert lve is not None
    assert lve.limit == 1
    assert lve.actual == 2
    assert lve.context == {'foo': 'bar'}
    assert lve.name == 'foo'

{'fraction_non_alphanumeric': 0.12088650100738751, 'fraction_numerical': 0.009402283411685695, 'mean_word_length': 3.4744744744744747, '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': '6339233', 'n_tokens_mistral': 472, 'n_tokens_neox': 470, 'n_words': 112}