This tests for errors thrown by getattr() or __getattr__ implementations that return an object for .command_name.
(caplog)
| 654 | |
| 655 | |
| 656 | async def test_collect_commands(caplog): |
| 657 | """ |
| 658 | This tests for errors thrown by getattr() or __getattr__ implementations |
| 659 | that return an object for .command_name. |
| 660 | """ |
| 661 | with taddons.context() as tctx: |
| 662 | c = command.CommandManager(tctx.master) |
| 663 | a = TCmds() |
| 664 | c.collect_commands(a) |
| 665 | assert "empty" in c.commands |
| 666 | |
| 667 | a = TypeErrAddon() |
| 668 | c.collect_commands(a) |
| 669 | assert "Could not load" in caplog.text |
| 670 | |
| 671 | |
| 672 | def test_decorator(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…