I need the python.exe exit code to detect if our unit test suite has failed.But propy.bat (ArcGIS Pro 2.1) does not preserve the exit code from python.exe.
Any ideas for a workaround - or could we maybe see it fixed in a coming release?
In propy.bat, try replacing the following
python.exe %* @call %deactivate_path%<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
with
python.exe %* @set pythonerror=%errorlevel% @call %deactivate_path% exit /b %pythonerror%<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Perhaps run your test suite in the arcgispro-py3 conda env (eg using proenv.bat) and call python directly rather than calling propy.bat.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.