loadNXDTestFile: use `compile` for better tracebacks on errors
When using compile with the actual file path, we can have better tracebacks in case of errors. before: Traceback (most recent call last): File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/bin/nxdtest", line 22, in <module> sys.exit(nxdtest.main()) File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/parts/nxdtest/nxdtest/__init__.py", line 142, in main tenv = loadNXDTestFile('.nxdtest') File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/parts/nxdtest/nxdtest/__init__.py", line 75, in loadNXDTestFile six.exec_(src, g) File "<string>", line 77, in <module> NameError: name 'Pylint' is not defined after: Traceback (most recent call last): File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/bin/nxdtest", line 22, in <module> sys.exit(nxdtest.main()) File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/parts/nxdtest/nxdtest/__init__.py", line 142, in main tenv = loadNXDTestFile('.nxdtest') File "/srv/slapgrid/slappart3/srv/runner/software/9544feb19475590d240ba2d32743c0a0/parts/nxdtest/nxdtest/__init__.py", line 75, in loadNXDTestFile six.exec_(compile(src, os.path.realpath(path), 'exec'), g) File "/srv/slapgrid/slappart3/srv/runner/instance/slappart8/var/nxdtest/.nxdtest", line 77, in <module> summaryf=Pylint.summary, NameError: name 'Pylint' is not defined /reviewed-by @kirr /reviewed-in !10
Showing
Please register or sign in to comment