ScreenPyHQ / screenpy

Screenplay pattern base for Python automated UI test suites.
MIT License
27 stars 3 forks source link

TypeError: Protocols with non-method members don't support issubclass() #110

Closed bandophahita closed 11 months ago

bandophahita commented 11 months ago

screenpy_selenium is seeing the following error when using issubclass(obj, ErrorKeeper) See issue.

TypeError: Protocols with non-method members don't support issubclass()

It looks like trying to move from typing_extensions.Protocol to typing.Protocol has an adverse effect. This is due in part because we have not released the switchover for screenpy. The net effect is a screenpy_selenium (which is using typing.Protocol) and screenpy ( which is using typing_extensions.Protocol )

I don't understand exactly WHY you can't mix these two.

bandophahita commented 11 months ago

Oh boy, this was not obvious...

Turns out the issue is due to the lack of @runtime_checkable on the test protocols. Which has me wondering how it was able to work at all prior to moving from typing_extensions.

bandophahita commented 11 months ago

This was solely an issue in screenpy_selenium. I wish the error had made that more clear.