<commit_before>
import unittest
from jktest.config import TestConfig
from jktest.jkind import JKind
from jktest.results import ResultList

class TestCase( unittest.TestCase ):
    def assertTrue( self, expr, msg = None ):
        super( TestCase, self ).assertTrue( expr, msg )



class JKTestCase( unittest.TestCase ):
# class JKTestCase( TestCase ):

    def __init__( self, methodName = 'runTest' ):
        unittest.TestCase.__init__( self, methodName = methodName )

    def setUp( self ):
        self.results = ResultList()
        self.file = TestConfig().popFile()

        for arg in TestConfig().nextArg():
            self.results.append( JKind( self.file, arg ).run() )

    def tearDown( self ):
        pass


    def test1( self ):
        resultsList = self.results.copy()
        controlList = resultsList.pop()

        for each in resultsList:

            ok = ( controlList == each )
            if( ok == False ):

                for jkr in controlList:
                    for line in ( jkr.failures() ):
                        print( line )

            self.assertTrue( ok, 'Test File: ' + self.file )






<commit_msg>Add prints for output formatting<commit_after>
import unittest
from jktest.config import TestConfig
from jktest.jkind import JKind
from jktest.results import ResultList

class TestCase( unittest.TestCase ):
    def assertTrue( self, expr, msg = None ):
        super( TestCase, self ).assertTrue( expr, msg )



class JKTestCase( unittest.TestCase ):
# class JKTestCase( TestCase ):

    def __init__( self, methodName = 'runTest' ):
        unittest.TestCase.__init__( self, methodName = methodName )

    def setUp( self ):
        self.results = ResultList()
        self.file = TestConfig().popFile()

        # Print test header for nicer output formatting
        print( '\n**********************************************' )
        print( 'BEGIN TEST OF: ' + str( self.file ) )

        for arg in TestConfig().nextArg():
            self.results.append( JKind( self.file, arg ).run() )

    def tearDown( self ):
        print( '\nEND TEST OF ' + str( self.file ) )



    def test_result( self ):
        resultsList = self.results.copy()
        controlList = resultsList.pop()

        for each in resultsList:

            ok = ( controlList == each )
            if( ok == False ):

                for jkr in controlList:
                    for line in ( jkr.failures() ):
                        print( line )

            self.assertTrue( ok, 'Test File: ' + self.file )







{'fraction_non_alphanumeric': 0.12121212121212122, 'fraction_numerical': 0.0003935458480913026, 'mean_word_length': 2.1577639751552793, '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': '4509064', 'n_tokens_mistral': 728, 'n_tokens_neox': 687, 'n_words': 218}