Adapt imports so that test/OLItest can be imported
To run the test suite from the main setup.py we need to be able to import and run the test suite from a different folder than the "test" dir. Make "test" a package and fix the imports to still work when imported from another folder. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
		| @@ -21,7 +21,7 @@ import shutil | ||||
| import subprocess | ||||
| import tempfile | ||||
| from ConfigParser import SafeConfigParser | ||||
| from OLItest import default_conf | ||||
| from . import default_conf | ||||
|  | ||||
| class OLITestLib(): | ||||
|     cred_file = None | ||||
|   | ||||
							
								
								
									
										0
									
								
								test/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								test/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -17,8 +17,8 @@ import random | ||||
| import unittest | ||||
| import logging | ||||
| import os, sys | ||||
| # Insert ".." into the python search path | ||||
| cmd_folder = os.path.dirname(os.path.abspath(__file__)) | ||||
| # Insert ".." into the python search path to get OLItest | ||||
| cmd_folder = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||||
| if cmd_folder not in sys.path: | ||||
|      sys.path.insert(0, cmd_folder) | ||||
| from OLItest import OLITestLib | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sebastian Spaeth
					Sebastian Spaeth