testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

fix(core): Add kwargs to image build

Open Tranquility2 opened this issue 1 year ago • 3 comments

Fix: #706, https://github.com/testcontainers/testcontainers-python/pull/614

Now when using kwargs in the Image API, the params are passed correctly into the build

with DockerImage(path=dir, tag="test", buildargs={"MY_ARG": "some_arg"}) as image:

Added relevant test + updated docstring to better reflect the usage

Tranquility2 avatar Oct 01 '24 20:10 Tranquility2

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (main@ace2a7d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #708   +/-   ##
=======================================
  Coverage        ?   84.77%           
=======================================
  Files           ?       12           
  Lines           ?      670           
  Branches        ?      105           
=======================================
  Hits            ?      568           
  Misses          ?       79           
  Partials        ?       23           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 01 '24 20:10 codecov[bot]

Can we perhaps add a hint to the docstring that kwargs will be passed down to docker-py? That would pretty much solve https://github.com/testcontainers/testcontainers-python/pull/614 for me.

black-snow avatar Oct 01 '24 21:10 black-snow

@black-snow Updated docstring as you suggested.

Tranquility2 avatar Oct 02 '24 11:10 Tranquility2