<commit_before>from datetime import datetime

import _mssql

from .helpers import mssqlconn, drop_table

class QueryTests(object):

    @classmethod
    def setup_class(self):
        self.mssql = mssqlconn()
        self.createTestTable()

    def tearDown(self):
        clear_table(self.mssql, 'pymssql')
        self.mssql.close()

    def createTestTable(self):
        try:
            self.mssql.execute_non_query("""
            CREATE TABLE pymssql (
                pk_id int IDENTITY (1, 1) NOT NULL,
                real_no real,
                float_no float,
                money_no money,
                stamp_datetime datetime,
                data_bit bit,
                comment_vch varchar(50),
                comment_nvch nvarchar(50),
                comment_text text,
                comment_ntext ntext,
                data_image image,
                data_binary varbinary(40),
                decimal_no decimal(38,2),
                numeric_no numeric(38,8),
                stamp_time timestamp
            )""")
            self.tableCreated = True
            self.testTableColCount = 15
        except _mssql.MSSQLDatabaseException, e:
            if e.number != 2714:
                raise

    def dropTestTable(self):
        self.mssql.execute_non_query('DROP TABLE pymssql')
        self.tableCreated = False

    def insertSampleData(self):
        for x in xrange(10):
            y = x + 1<commit_msg>Make tests/test_queries.py actually run tests.<commit_after>from datetime import datetime
import unittest

import _mssql

from .helpers import mssqlconn, drop_table

class QueryTests(unittest.TestCase):

    @classmethod
    def setup_class(cls):
        cls.mssql = mssqlconn()
        cls.createTestTable()

    @classmethod
    def teardown_class(cls):
        cls.dropTestTable()
        cls.mssql.close()

    @classmethod
    def createTestTable(cls):
        try:
            cls.mssql.execute_non_query("""
            CREATE TABLE pymssql (
                pk_id int IDENTITY (1, 1) NOT NULL,
                real_no real,
                float_no float,
                money_no money,
                stamp_datetime datetime,
                data_bit bit,
                comment_vch varchar(50),
                comment_nvch nvarchar(50),
                comment_text text,
                comment_ntext ntext,
                data_image image,
                data_binary varbinary(40),
                decimal_no decimal(38,2),
                numeric_no numeric(38,8),
                stamp_time timestamp
            )""")
            cls.tableCreated = True
            cls.testTableColCount = 15
        except _mssql.MSSQLDatabaseException as e:
            if e.number != 2714:
                raise

    @classmethod
    def dropTestTable(cls):
        cls.mssql.execute_non_query('DROP TABLE pymssql')
        cls.tableCreated = False

    def insertSampleData(self):
        for x in range(10):
            y = x + 1
{'fraction_non_alphanumeric': 0.07264814194844325, 'fraction_numerical': 0.015400066956812855, 'mean_word_length': 1.6073298429319371, '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': '1033719', 'n_tokens_mistral': 908, 'n_tokens_neox': 833, 'n_words': 194}