pytest-docker | Docker-based integration tests | Continuous Deployment library
kandi X-RAY | pytest-docker Summary
kandi X-RAY | pytest-docker Summary
Docker-based integration tests
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pytest-docker
pytest-docker Key Features
pytest-docker Examples and Code Snippets
Community Discussions
Trending Discussions on pytest-docker
QUESTION
I saw this question, asking the same about doing things before tests.
I need to do things before fixtures.
For example, I am setting up a dockerized environment, which I have to clean before building. To make things more complicated, I am using this plugin which defines fixtures I can't control or change, and I need something that comes before all fixtures (and does docker-compose down
and other cleanup).
For example, when pytest starts, run the common per-session pre-step, then the fixtures, then the per-module pre-step, then the fixtures, and so on.
Is this a supported hook in pytest?
I couldn't find a relevant doc.
...ANSWER
Answered 2022-Feb-08 at 14:18As @MrBean Bremen stated, pytest_sessionstart does the trick.
An annoying problem with that, is I can't use fixtures inside (naturally), with Argument(s) {'fixture_name'} are declared in the hookimpl but can not be found in the hookspec
I tried to fix that with pytest-dependency, but it doesn't seem to work on fixtures, only on tests.
I am left with the hacky workaround to extract required data for sessionstart
to functions, and call them in sessionstart
as well as in similarly named fixtures.
It works, but it is ugly.
Would accept a cleaner solution over this one
QUESTION
This does not solve my problem, as I have no escaping issues.
I have a rabbit.env
:
ANSWER
Answered 2022-Jan-30 at 17:59In the Compose file, you've named the network atp
QUESTION
I'm trying to setup a project which should run e2e selenium based tests written in python inside a pipeline running on Gitlab CI. The goal is to use pytest-docker in order to use a docker-compose file to launch the needed applications before we can run the tests (This is just to justify why I'm using dind service and docker/compose image). However, I'm having issues with just running a simple test (which opens http://www.python.org and checks the title) inside Gitlab CI (locally runs fine).
So the test I'm trying to run is this:
...ANSWER
Answered 2021-Nov-16 at 00:11This is a known issue with running Firefox in Docker. It was fixed in Firefox 84.
For versions before Firefox 84, you have to increase the docker container's /dev/shm
size (which is 64MB by default) to a size usable by Firefox, like 1g or larger. However, as far as I know, this isn't configurable using GitLab's shared runners. Therefore, you would need to self-host a GitLab runner for this or use another CI/browser provider for these older firefox versions.
QUESTION
I'm using Python 3.8 with the pytest-docker-compose plugin -- https://pypi.org/project/pytest-docker-compose/ . Does anyone know how to write a URL that would eventually tell me if my SQL Server is running?
I have this docker-compose.yml file
...ANSWER
Answered 2020-Jul-24 at 04:25if connection.is_connected():
db_Info = connection.get_server_info()
print("Connected to MySQL Server version ", db_Info)
cursor = connection.cursor()
cursor.execute("select database();")
record = cursor.fetchone()
print("You're connected to database: ", record)
QUESTION
I am trying to run my pytest (bdd) test cases in virtualenv. I have created a requirements.txt (using pip freeze) file in the root folder as below.
...ANSWER
Answered 2020-Jul-28 at 11:02There's an open issue with pytest-yield
that prevents it to work with latest pytest
version (5.1 and up): #6. This means that you have either to downgrade to an older version of pytest
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pytest-docker
You can use pytest-docker like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page