pulumi/sdk/python/lib
Justin Van Patten af3d4b890d
Allow pulumi.export calls from unit tests (#4670)
The previous attempt to allow this didn't actually allow it, so this is
take two. As part of the previous attempt, I thought after tweaking the
test I had observed the test failing, and then succeeding after making
the product changes, but I must have been mistaken.

It turns out that our existing mocks tests weren't running at all
because of a missing `__init__.py` file. Once the missing `__init__.py`
is added, the tests run, but other tests ("test mode" tests) fail
because the code that creates the mocks and resources will run during
test discovery, and setting the mocks modifies global state.

To address the test issue, I've moved the mocks tests into their own
`test_with_mocks` package that can be run separately from other tests.

And addressed the original issue, by creating a root Stack resource if
one isn't already present when the mocks are set.
2020-05-20 09:54:40 -07:00
..
pulumi Allow pulumi.export calls from unit tests (#4670) 2020-05-20 09:54:40 -07:00
test Allow pulumi.export calls from unit tests (#4670) 2020-05-20 09:54:40 -07:00
test_with_mocks Allow pulumi.export calls from unit tests (#4670) 2020-05-20 09:54:40 -07:00
setup.py Add py.typed to Python package for PEP 561 compliance (#3704) 2020-01-17 15:01:36 -08:00