8000 Remove class-level variables from containers. by tillahoffmann · Pull Request #296 · testcontainers/testcontainers-python · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@tillahoffmann
Copy link
Contributor
@tillahoffmann tillahoffmann commented Jan 7, 2023

Several of the containers currently load environment variables at import time. Consequently, if we create a container, its configuration may not match the current environment variables. Containers also overwrite class variables with instance variables of the same name which can cause confusion.

This PR

  • removes all class-level variables and loads environment variables at the time the container is created.
  • unifies the container API by renaming user to username and port_to_expose to port where applicable such that all containers have the same parameter names. The motivation behind renaming port_to_expose is that some containers have multiple different ports (cf. Clickhouse container exposing ports setup is strange #257 and Add azurite module #234). [specific]_port_to_expose is just a bit long.

This will break a bunch of stuff, but I'm planning to squeeze a lot of this cleanup into the next major release.

@pffijt pffijt self-requested a review February 23, 2023 11:36
@pffijt
Copy link
Contributor
pffijt commented Feb 23, 2023

We should fix the minor inconsistencies then this pr should be ready for merge.

@tillahoffmann tillahoffmann requested a review from nshine as a code owner April 11, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0