pulumi/sdk/python/lib/test
Fraser Waters 4cbc3e46b2
Fix python source positions for new SDKs (#18575)
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.
2025-02-12 18:21:46 +00:00
..
automation Bump `go-git` to 5.13.1 (#18247) 2025-01-15 21:34:14 +00:00
data/lazy_import_test [sdk/python] Workaround lazy module regression (#16038) 2024-04-24 06:53:59 +00:00
dynamic Allow accessing configuration in Python dynamic providers (#17673) 2024-11-07 10:12:24 +00:00
langhost Fix python source positions for new SDKs (#18575) 2025-02-12 18:21:46 +00:00
provider [Experimental/Components] Detect more map and array types (#18546) 2025-02-12 14:05:24 +00:00
runtime Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
__init__.py Fix a couple of issues when projecting Protobuf and UNKNOWN in Python (#1468) 2018-06-06 16:09:07 -07:00
conftest.py Use black to format lib/test (#16028) 2024-04-23 08:29:58 +00:00
helpers.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_broken_dynamic_provider.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_config.py Use black to format lib/test (#16028) 2024-04-23 08:29:58 +00:00
test_deprecated.py Fixing a few pylint errors in the python test folder (#16962) 2024-08-14 08:26:34 +00:00
test_invoke.py Permit output arguments in plain invokes for backwards compatibility (#18304) 2025-01-21 14:27:59 +00:00
test_monitor_termination.py Fixing a few pylint errors in the python test folder (#16962) 2024-08-14 08:26:34 +00:00
test_next_serialize.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_output.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_resource.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_runtime_to_json.py Use black to format lib/test (#16028) 2024-04-23 08:29:58 +00:00
test_stack_reference.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_stack_registers_outputs.py Switch to ruff for linting and formatting (#17882) 2024-12-02 12:41:19 +00:00
test_translate_output_properties.py Start mypy linting lib/test (#16040) 2024-04-30 12:54:13 +00:00
test_types_input_type.py Fixing a few pylint errors in the python test folder (#16962) 2024-08-14 08:26:34 +00:00
test_types_input_type_types.py Start mypy linting lib/test (#16040) 2024-04-30 12:54:13 +00:00
test_types_output_type.py Fixing a few pylint errors in the python test folder (#16962) 2024-08-14 08:26:34 +00:00
test_types_resource_types.py Start mypy linting lib/test (#16040) 2024-04-30 12:54:13 +00:00
test_urn.py Use black to format lib/test (#16028) 2024-04-23 08:29:58 +00:00
test_utils.py Start mypy linting lib/test (#16040) 2024-04-30 12:54:13 +00:00