PyCharm: Unreachable Code?
I actually think this is a bug in PyCharm, thinking that fail
refers to TestCase.fail
, which would in fact make the code unreachable.
If I use your example, but rename fail
to for example failure
, the errors disappears. I'd report this bug to the friendly folks at PyCharm to see if this is in fact the case.