<s> import sys <EOL> import os <EOL> from unittest import TestCase <EOL> PY3 = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> <EOL> if PY3 : <EOL> import unittest . mock as mock <EOL> else : <EOL> import mock <EOL> class CleoTestCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . fixtures_path = os . path . join ( <EOL> os . path . dirname ( os . path . realpath ( __file__ ) ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> def assertRegex ( self , * args , ** kwargs ) : <EOL> if PY3 : <EOL> return super ( CleoTestCase , self ) . assertRegex ( * args , ** kwargs ) <EOL> else : <EOL> return self . assertRegexpMatches ( * args , ** kwargs ) <EOL> def assertNotRegex ( self , * args , ** kwargs ) : <EOL> if PY3 : <EOL> return super ( CleoTestCase , self ) . assertNotRegex ( * args , ** kwargs ) <EOL> else : <EOL> return self . assertNotRegexpMatches ( * args , ** kwargs ) <EOL> def mock ( self ) : <EOL> return mock <EOL> def open_fixture ( self , fixture ) : <EOL> with open ( os . path . join ( self . fixtures_path , fixture ) ) as fh : <EOL> return fh . read ( ) </s>
