Skip to content

Conversation

@romnn
Copy link
Contributor

@romnn romnn commented Sep 6, 2020

This PR proposes some changes for discussion.

I really enjoy using testcontainers and have used them in both Go and Java. In my opinion, there are some things missing or out of scope for this python implementation.

  1. It is bad practice to use plain print() inside of python modules and one should always use the logging module so the end user can decide for himself if and what messages are of interest and should be logged.
  2. In my opinion, the use-case for this kind of library clearly is integration testing in CI environments. Under this assumption I think purely cosmetic features like spinners and colored text are not required and only add dependencies.

Let me know your point on this.
Best, Roman

Copy link
Contributor

@tillahoffmann tillahoffmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point. A few small suggestions.

print("")
print("Container started: ",
crayons.yellow(self._container.short_id, bold=True))
logger.info("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info("")

volumes=self.volumes,
**self._kargs
)
logger.info("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info("")

print("Container started: ",
crayons.yellow(self._container.short_id, bold=True))
logger.info("")
logger.info("{} {}".format("Pulling image", self.image))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the standard approach for parameter substitution in logs throughout.

@tillahoffmann tillahoffmann merged commit 2b2037e into testcontainers:master Sep 9, 2020
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.

2 participants