Comments (2)
Hi, testinfra is based on the pytest framework, so you could write setup/teardown function that build and run the container, then test it using testinfra fixtures.
For some example you could look how testinfra test itself using docker, this is similar to: https://testinfra.readthedocs.io/en/latest/examples.html#test-docker-images
Btw, It would be nice to have a documentation with a simple snippet of code to test a single Dockerfile.
from pytest-testinfra.
cross ref to docker-unit: https://github.com/l0rd/docker-unit
from pytest-testinfra.
Related Issues (20)
- pytest-testinfra breaks native pytest features HOT 1
- Timeout argument for run() HOT 7
- Executing tests from Ansible Tower/Ansible AWX
- The package comparison option in the package module is not working as expected. HOT 1
- Testinfra fails if the "~/.ansible/cp" path doesn't exist HOT 2
- Environment class not clickable in module documenation
- changelog missing for v10.0.0
- Winrm Issue
- service is_running does not work with exit code 4 HOT 1
- Support for user and global service for systemd ?
- Don't correctly parse contain @ ssh password HOT 2
- Broken compatibility with pytest<7 (pytest.Parser type annotation) HOT 6
- `SystemdService.exists` fails with an error due to a malformed command HOT 2
- `host.package().is_installed` is returning True incorrectly when the RPM database is corrupted.
- pre-commit fails on Python 3.12
- File.user on symlink has changed comportement
- service.exists with systemd fails
- Got empty parameter set ['_testinfra_host'] after update HOT 1
- zlib1g not detected by package module HOT 1
- Consider using the Docker/Podman API instead of subprocess?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-testinfra.