<commit_before>from pytest import raises
from tests import ViewTestCase
from .extensions import db
from .models import User
from flask.templating import TemplateNotFound
from flask_generic_views import SortedListView


class ListViewTestCase(ViewTestCase):
    def setup_method(self, method):
        ViewTestCase.setup_method(self, method)
        self.view = SortedListView.as_view('index', model_class=User)
        self.app.add_url_rule('/users',
            view_func=self.view,
        )

        john = User(name=u'<NAME>', age=35)
        jack = User(name=u'<NAME>', age=60)
        luke = User(name=u'<NAME>', age=30)
        vader = User(name=u'<NAME>', age=55)
        db.session.add(john)
        db.session.add(jack)<commit_msg>with statement support for python 2.5<commit_after>from __future__ import with_statement

from pytest import raises
from tests import ViewTestCase
from .extensions import db
from .models import User
from flask.templating import TemplateNotFound
from flask_generic_views import SortedListView


class ListViewTestCase(ViewTestCase):
    def setup_method(self, method):
        ViewTestCase.setup_method(self, method)
        self.view = SortedListView.as_view('index', model_class=User)
        self.app.add_url_rule('/users',
            view_func=self.view,
        )

        john = User(name=u'<NAME>', age=35)
        jack = User(name=u'<NAME>', age=60)
        luke = User(name=u'<NAME>', age=30)
        vader = User(name=u'<NAME>', age=55)
        db.session.add(john)
        db.session.add(jack)
{'fraction_non_alphanumeric': 0.11067961165048544, 'fraction_numerical': 0.011650485436893204, 'mean_word_length': 3.442528735632184, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5685074', 'n_tokens_mistral': 493, 'n_tokens_neox': 476, 'n_words': 108}