mirror of https://github.com/pulumi/pulumi.git
![]() Fixes https://github.com/pulumi/pulumi/issues/18478 At some point python SDKs started using an `__internal_init__` method as part of generated resource constructors. This changed the expected height of user code in the stack traces we grab for setting `sourcePosition` and our tests never picked this up because they used a handwritten SDK that only had an `__init__` method. This updates the test so that one resource has an `__internal_init__` that is called by `__init__` and then fixes `get_source_position` so it can handle both cases. It does this by looking up the stack for the third `__init__` call and then picking the frame above that. Still a bit brittle, but I think it's the best you can do by just looking at function names, and we're probably not going to add anymore classes into the inheritance chain. |
||
---|---|---|
.. | ||
__init__.py | ||
__main__.py | ||
test_source_position.py |