teemtee / tmt

Test Management Tool
MIT License
86 stars 130 forks source link

Add exception `from` clause to exception handlers and enable B904 rule #3308

Open martinhoyer opened 1 month ago

martinhoyer commented 1 month ago

Briefly discussed in https://github.com/teemtee/tmt/pull/3239#discussion_r1808777407, the raise-without-from-inside-except (B904) could be removed from the lint ignore list and existing exceptions violating this rule could be 'fixed'.

LecrisUT commented 4 weeks ago

Does anyone know how to use raise ... from to catch either exception type? Or if there are other methods to do so? Otherwise is there a design for how the exceptions should be handled with tmt exception, built-in python and third-party, like where to put catch-alls, where to transform the exceptions, etc?