You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example is contrived, but its a simplification I was testing some nested transaction context handlers.
And was supprised that pylance told me the code was unreachable on line 14.
importunittestfromcontextlibimportsuppressclassTransactionError(Exception):
passclassTestSomething(unittest.TestCase):
deftest_something(self):
withsuppress(TransactionError):
raiseTransactionErrorself.assertTrue(True) ### HERE this is grey for being unreachable
The text was updated successfully, but these errors were encountered:
Environment data
Language Server version: 2020.10.3
OS and version: macOS Catalina 10.15.7
Python version: 3.9.0 (installed via homebrew)
Expected behaviour
https://docs.python.org/3/library/contextlib.html#contextlib.suppress
Actual behaviour
Pylance says the code is unreachable
Code Snippet / Additional information
This example is contrived, but its a simplification I was testing some nested transaction context handlers.
And was supprised that pylance told me the code was unreachable on line 14.
The text was updated successfully, but these errors were encountered: