pulumi/sdk/python
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
..
cmd Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
dist Support for running Python policy packs (#4057) 2020-03-18 16:15:57 -07:00
lib Allow `pulumi.export` calls from unit tests (#4670) 2020-05-20 09:54:40 -07:00
.gitignore add .venv/ to python .gitignore to ignore when using PIPENV_VENV_IN_PROJECT=1 2019-06-19 12:43:04 -07:00
.pylintrc Make 'ResourceOptions.merge' static so downstream clients don't have to manually handle None cases. (#3072) 2019-08-14 15:55:03 -07:00
Makefile Allow `pulumi.export` calls from unit tests (#4670) 2020-05-20 09:54:40 -07:00
Pipfile Enable mypy (#3758) 2020-01-17 14:45:08 -08:00
Pipfile.lock Enable mypy (#3758) 2020-01-17 14:45:08 -08:00
mypy.ini Allow oversize protocol buffers (#3895) 2020-02-10 15:30:42 -07:00