I’m working on a project that needs lots of toolbars on screen at once, even though not all of them will be used at the same time. So, I’m modelling this ‘foldable’ dock widget after what I remember Photoshop panels used to be like.
It’s a work in progress, but would like to hear constructive suggestions.
https://blocks.programming.dev/0101100101/42c5d67f86c049baa3500aa38e439f8a
Recommend against the ternary expression.
coverage
might not detect the two code blocks. Would also not be able to apply# pragma: no cover
comment to a code block that isn’t important enough to justify testing it. Often usedo nothing
code blocks.self.float_button.setIcon(self.icon_dock if is_floating else self.icon_float)
lets say while testing something goes wrong and trying to debug what happened.Will not see the value that gets past into
self.float_button.setIcon
I like your idea of having the param be keyword only. Makes it more readable.
If you branch coverage tool can’t handle branches on the same line I would suggest you use a different one! Does it handle
if foo or bar
?Uhm, yes you will? Just step into the function.