<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""

from __future__ import unicode_literals
import pytest
import queue


@pytest.fixture(scope="function")
def create_queue(request):
    """Create a queue with numbers 1 - 5"""
    new_queue = queue.Queue()
    for i in range(1, 6):
        new_queue.enqueue(i)
    return new_queue


def test_dequeue(create_queue):
    first_queue = create_queue()
    first_val = first_queue.dequeue()
    assert first_val is 1
    assert first_queue.size() is 4
    second_val = first_queue.dequeue()
    assert second_val is 2
    assert first_queue.size() is 3


def test_enqueue(create_queue):
    second_queue = create_queue()
    second_queue.enqueue(6)
    assert second_queue.size() is 6
    foo = second_queue.dequeue()
    assert foo is 1
    assert second_queue.size() is 5


def test_empty(create_queue):
    empty = queue.Queue()
    assert empty.size() is 0
    with pytest.raises("ValueError"):
        empty.dequeue<commit_msg>Fix errors in test file<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""

from __future__ import unicode_literals
import pytest
import queue


@pytest.fixture(scope="function")
def create_queue(request):
    """Create a queue with numbers 1 - 5
    """
    new_queue = queue.Queue()
    for i in range(1, 6):
        new_queue.enqueue(i)
    return new_queue


def test_dequeue(create_queue):
    """Test that the queue shrinks and returns first in
    """
    first_queue = create_queue
    first_val = first_queue.dequeue()
    assert first_val is 1
    assert first_queue.size() is 4
    second_val = first_queue.dequeue()
    assert second_val is 2
    assert first_queue.size() is 3


def test_enqueue(create_queue):
    """Test that the queue grows and returns first in
    """
    second_queue = create_queue
    second_queue.enqueue(6)
    assert second_queue.size() is 6
    foo = second_queue.dequeue()
    assert foo is 1
    assert second_queue.size() is 5


def test_empty(create_queue):
    """Test that empty queue size method returns 0 and dequeue raises IndexError
    """
    empty = queue.Queue()
    assert empty.size() is 0
    with pytest.raises(IndexError):
        empty.dequeue()
{'fraction_non_alphanumeric': 0.09595959595959595, 'fraction_numerical': 0.012205387205387205, 'mean_word_length': 3.313974591651543, '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': '1247989', 'n_tokens_mistral': 774, 'n_tokens_neox': 747, 'n_words': 237}