return dirname(join(os.getcwd(), sys._getframe(1).f_globals['__file__'])) def addImportPath(path): '''Function that adds the specified path to the import path. The path can be absolute or relative to the calling file.''' importPath = abspath(join(currentPath(), path)) sys.path = [ importPath ] + sys.path addImportPath('.') # for the tests addImportPath('../..') # for import smewt import smewt from smewt import * from pygoo import * from smewt.solvers import * from smewt.guessers import * from smewt.media import * # before starting any tests, save smewt's default ontology in case we mess with it and need it again later ontology.save_current_ontology('media') from smewt.base import cache cache.load('/tmp/smewt.cache') def shutdown(): cache.save('/tmp/smewt.cache') def allTests(testClass): return TestLoader().loadTestsFromTestCase(testClass)
def addImportPath(path): '''Function that adds the specified path to the import path. The path can be absolute or relative to the calling file.''' importPath = abspath(join(currentPath(), path)) sys.path = [importPath] + sys.path addImportPath('.') # for the tests addImportPath('../..') # for import smewt import smewt from smewt import * from pygoo import * from smewt.solvers import * from smewt.guessers import * from smewt.media import * # before starting any tests, save smewt's default ontology in case we mess with it and need it again later ontology.save_current_ontology('media') from smewt.base import cache cache.load('/tmp/smewt.cache') def shutdown(): cache.save('/tmp/smewt.cache') def allTests(testClass): return TestLoader().loadTestsFromTestCase(testClass)
def loadCache(self): cache.load(self._cacheFilename())