• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

schireson / pytest-mock-resources / 25217096087
89%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 02:00PM UTC
Jobs 1
Files 39
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 May 2026 01:59PM UTC coverage: 88.845% (+0.05%) from 88.796%
25217096087

push

github

web-flow
feat: Allow defining run_args via container_args on container config (#231)

* feat: Allow defining run_args via container_args on container config

Wires up the existing-but-unused `container_args` field on
`DockerContainerConfig` to forward arbitrary keyword arguments into the
underlying `python_on_whales.DockerClient.run` call. Previously users
could not pass custom `docker run` flags (e.g. `memory`, `cpus`,
`labels`, `platform`) that were not otherwise exposed through the
existing config fields.

Design notes:
- Chose a `Mapping[str, Any]` shape because the underlying docker call
  goes through python-on-whales, which uses one keyword per flag. A
  string + space-split approach, while simpler on paper, does not map
  cleanly to that API.
- User-supplied kwargs are spread first; pmr-managed kwargs (ports,
  envs, name, detach, remove) override so the fixture plumbing cannot
  be broken by accident.
- Added `container_args` to the `_fields` of each subclass so the
  `__init__` accepts it uniformly across postgres, mysql, mongo, redis,
  redshift, and moto configs. Default is an empty dict.

Tests:
- 3 new unit tests in `tests/test_config.py` covering default value,
  user-supplied mapping, and env-var fallback behavior.
- 5 new tests in `tests/test_wait_for_container.py` that mock
  `python_on_whales.DockerClient` and verify the kwargs propagate,
  that pmr-managed kwargs cannot be overridden, and that the feature
  accepts None/empty/populated shapes.

Closes #185.

* fix: skip container wiring tests when python_on_whales is unavailable

The make test-base target intentionally runs without the docker extras
installed. The new tests in test_wait_for_container.py actually invoke
wait_for_container, which imports python_on_whales lazily at call time.
Guard the module with pytest.importorskip so the base matrix passes.

* fix: skip wiring tests when python-on-whales DockerException is unavailable

The earlier importorskip('python_on_whales') check was ... (continued)

343 of 423 branches covered (81.09%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 3 files covered. (100.0%)

1465 of 1612 relevant lines covered (90.88%)

16.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run- - 25217096087.1 01 May 2026 02:04PM UTC 39
88.85
GitHub Action Run
Source Files on build 25217096087
  • Tree
  • List 39
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • cc13a966 on github
  • Prev Build on main (#24798864780)
  • Next Build on main (#25514383959)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc