Define reveal_type in tests at runtime
If anything we should define reveal_type in our tests and define it at runtime
Sounds like the best solution, let's do that then.
Originally posted by @shiftinv in https://github.com/DisnakeDev/disnake/pull/557#discussion_r913202529
This would be done by defining a reveal_type method in tests/helpers.py and importing it in each file that uses reveal_type. Ideally this would have the same arguments as pyright's reveal_type method, but most importantly, this should raise a RuntimeError if the function it called.
typing.reveal_type was added in 3.11 (cpython commit), and was also backported to typing_extensions 4.1.0, which we could use as tests already depend on typing_extensions.
typing.reveal_typewas added in 3.11 (cpython commit), and was also backported to typing_extensions 4.1.0, which we could use as tests already depend on typing_extensions.
Unfortunately that won't entirely work as the typing.reveal_type method only takes a single argument.