正在放入调试器

启动A pdb.post_mortem() 错误和失败。

此插件实现 testOutcome() 当它看到一个包含exc_信息的测试结果时,就会进入pdb。

它开火了 beforeInteraction() 在启动PDB和 afterInteraction() 之后。其他插件可能实现 beforeInteraction() 归来 False 并设置 event.handled 以阻止此插件启动PDB。

配置 [调试器]

always-on
违约:

类型:

布尔

errors-only
违约:

类型:

布尔

示例配置

默认配置相当于在 unittest.cfg 文件。

[debugger]
always-on = False
errors-only = False

命令行选项

-D DEFAULT, --debugger DEFAULT

测试失败或错误时输入PDB

插件类引用:调试器

class nose2.plugins.debugger.Debugger(*args, **kwargs)[源代码]

测试错误或失败时输入PDB

pdb

为了便于模拟和使用不同的PDB实现,PDB被命名为类属性。

pdb = <module 'pdb' from '/usr/lib/python3.12/pdb.py'>
testOutcome(event)[源代码]

在发生意外错误或失败时放入PDB