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

Move with_overwritten_file_context to PantsRunIntegrationTest #7408

Merged

Conversation

Projects
None yet
3 participants
@blorente
Copy link
Contributor

commented Mar 20, 2019

Problem

It would be good to have this in the same place as temporary_file_content, as they both do the same thing and they are both used for integration tests.
This PR also adds an optional parameter to have the context manager pre-fill the contents of the file for you.

Result

Not much has changed, but now with_overwritten_file_context lives in PantsRunIntegrationTest

@blorente blorente requested review from illicitonion and ity Mar 20, 2019

@illicitonion
Copy link
Contributor

left a comment

Thanks!

file_original_content = f.read()

try:
if temporary_content:

This comment has been minimized.

Copy link
@illicitonion

illicitonion Mar 20, 2019

Contributor
Suggested change
if temporary_content:
if temporary_content is not None:

Otherwise the empty string won't get written :)

@ity

ity approved these changes Mar 20, 2019

Copy link
Contributor

left a comment

thanks

@blorente blorente merged commit e043897 into pantsbuild:master Mar 21, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.