Package tlib :: Module conftest
[hide private]
[frames] | no frames]

Source Code for Module tlib.conftest

 1  import os 
 2  import sys 
 3  import ConfigParser 
 4   
 5  #get project root directory path 
 6  _root_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))    #: Root directory of the project folder containing all the tests 
 7   
 8  #if we are testing the TLib class, add a file called "testingTlib" next to this file 
 9  if os.path.exists("testingTlib"): 
10      lib_path = os.path.abspath(os.path.join(_root_dir,"TLib")) 
11      sys.path.insert(1, lib_path) 
12   
13  #get the project config file and read it 
14  prj_config = ConfigParser.ConfigParser()             #: ConfigParser that reads the projects configuration from config/config.ini 
15  prj_config.read(os.path.join(_root_dir,'config.ini')) 
16