Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use pytest over unittest #1037

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

jandom
Copy link
Contributor

@jandom jandom commented Jul 3, 2021

@stack72 this is a re-worked unittest into pytest example – I'm not actually advocating dropping the unittest docs but I would say pytest is the more popular choice in 2021?

Also, I have further improvements for docs around code that uses

  • Unit testing programs that use Pulumi config (very commonly used, very tricky to get to work with unit tests)
  • Unit testing component resources (couldn't really find any docs on that?)

@github-actions
Copy link

github-actions bot commented Jul 3, 2021

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-example-tests on the PR

@jandom
Copy link
Contributor Author

jandom commented Jul 8, 2021

Hi there, the PR has been opened for a few days now and I'm wondering if it's helpful at all, or what to do to make it actually helpful rather than just helpful in my eyes? ;-)

@stack72
Copy link
Contributor

stack72 commented Jul 20, 2021

/run-example-tests

@github-actions
Copy link

Please view the results of the PR Build Here

@stack72
Copy link
Contributor

stack72 commented Jul 20, 2021

Sorry @jandom - I am finally catching up here! This does indeed read much nicer :) I am happy to merge this in - I need to fix a CI build which runs the pip3 install command but it will be ok

Tests are running now

@stack72 stack72 merged commit abeb696 into pulumi:master Jul 20, 2021
@jandom
Copy link
Contributor Author

jandom commented Jul 20, 2021

Awesome stuff @stack72 – I wasn't sure what was happening there. It's a pretty big shift to recommend pytest over unittest but I think that's the preferred one.

I was also thinking of writing up how to test composite components and stacks using pulumi.config? These are both useful advanced test cases that are not super-straightforward and any serious user will bump into them

dixler pushed a commit that referenced this pull request Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants