U ec@s@dZddlmZddlmZmZddlmZGdddeZdS)a0 This plugin provides assert introspection. When the plugin is enabled and a test failure occurs, the traceback is displayed with extra context around the line in which the exception was raised. Simple variable substitution is also performed in the context output to provide more debugging information. )Plugin)exc_to_unicode force_unicode)inspect_tracebackc@s,eZdZdZdZddZddZddZd S) FailureDetailzP Plugin that provides extra information in tracebacks of test failures. i@c Cs"|jdddd|ddddd S) z'Register commmandline options. z-dz--detailed-errorsz--failure-detail store_trueZNOSE_DETAILED_ERRORSdetailedErrorszZAdd detail to error output by attempting to evaluate failed asserts [NOSE_DETAILED_ERRORS])actiondefaultdesthelpN) add_optionget)selfparserenvrH/opt/hc_python/lib/python3.8/site-packages/nose/plugins/failuredetail.pyoptionsszFailureDetail.optionscCs|js dS|j|_||_dS)zConfigure plugin. N)Z can_configurerenabledconf)rrrrrr configureszFailureDetail.configurecCsF|\}}}dt|}}|r6tt|}d||g}||_|||fS)zLAdd detail from traceback inspection to error message of a failure. N )rrrjointbinfo)rtesterrecZevtbrZstr_evrrr formatFailure&s  zFailureDetail.formatFailureN)__name__ __module__ __qualname____doc__Zscorerrrrrrrr s  rN) r#Z nose.pluginsrZnose.pyversionrrZnose.inspectorrrrrrrs