-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add CustomContainer exposing settings through the class #238
base: main
Are you sure you want to change the base?
Conversation
Great, thank you! Slight misunderstanding: I was thinking that we could add this functionality to existing containers rather than create a new one. What do you think? |
I don't there is any current class (except for the deprecated |
The image name can be specified for testcontainers-python/testcontainers/core/container.py Lines 12 to 13 in 7346345
|
True, you have a point there. Just to clarify, do you suggest extending the I think the DockerContainer approach would be convenient and won't require a new class. I can test the approach tomorrow and see if it would impact existing implementations. |
I was thinking all the containers as they all inherit from |
Ah, good thought. Sorry for not picking up on this but I'll update the PR. |
6e3291a
to
8622477
Compare
@tillahoffmann updated the PR to instead set these in the core container's If so, I'll make sure these changes are covered by tests as well. |
Ping @tillahoffmann this is another great PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I left a few small comments. If you could add tests, that'd be great! 🙏
Will take a look and add tests and do the updates when I am back at a computer (might take a few weeks) |
Co-authored-by: Till Hoffmann <tillahoffmann@gmail.com>
ac8b58f
to
2c4eb3b
Compare
Add test that tests that attributes can be set through the __init__ function and later read through class attr. This test does not test that the attributes has an actual effect, in the future it might be of interest to test the integration to the docker container and ensure that class attributes are propagated properly.
@tillahoffmann please take a look at the tests. I added test that tests that attributes can be set through the init function and later read through class attr. The test does not test that the attributes has an actual effect, in the future it might be of interest to test the integration to the docker container and ensure that class attributes are propagated properly. However, I for the changes in this PR I think the current is good enough. |
Add a
CustomContainer
exposing the settings through the class.Close #236