TestComplete lock library files after first run
Hi, I faced with problem when importing several librarys. On first test run everythins works as expected, but if I try to run agait the same routine without re-run testcomplete I get an error. The problem is that library files was locked by testcomplete process on first run, and they was not released after test is finished. Here my code: sys.path.insert(0, Project.Path + '..\\Lib') sys.path.insert(0, Project.Path + '..\\..\\') from APItests import LogGenerator import io nism_ip = ProjectSuite.Variables.NismIP falcon_ip = Project.Variables.MARipageURL.split('/')[2] f = io.StringIO() sys.stdout = f sys.stderr = f def clear_logs(): """ Clear all log events on falcon """ LogGenerator.clear_logs(falcon_ip, nism_ip) print_stdout() def print_stdout(): """ Function to print in Log.Message the 'print()' statement """ output = f.getvalue().split('\n') for o in output: Log.Message(o) f.seek(0) f.truncate(0) On first run of 'clear_logs()' routine it's passed, but on second run there has error: SystemError: initialization of _psycopg raised unreported exception 9:52:03 Normal 0.00 The script execution was interrupted. 9:52:03 Normal 0.18 TestComplete locks files for psycopg2 and for lxml librarys. As workaround I found only one solution - rerun testcomplete Anyone have sugestions how to fix these issue?1.4KViews0likes1CommentCan't import files in Python
I'm simply trying to use an import statement to import some constants in a python test script and its not working. the file I'm trying to import is in my project and in the same directory as the file that's trying to import it.I've looked through the specifics of usage for Python and even copied the file into <TestComplete>\Bin\Extensions\Python\Python34\Lib folder but still nothing. The specifics of usage also says you can"changethe sys_path variable explicitly and then import the module" but Sys doesn't even have a "path" property.Solved2.3KViews0likes2Comments