We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
conftest.py:
@pytest.fixture(scope="session") def mysql_container(): mysql = MySqlContainer("mysql:9").with_env("MYSQL_ROOT_PASSWORD", "root") with mysql: yield mysql @pytest.fixture(scope="module", autouse=True) def setup_database(mysql_container, django_db_blocker): settings.DATABASES["default"]["HOST"] = mysql_container.get_container_host_ip() settings.DATABASES["default"]["PORT"] = mysql_container.get_exposed_port(3306)
github_actions.yml
- name: Pytest uses: pavelzw/pytest-action@v2 with: verbose: true emoji: false job-summary: false custom-pytest: PYTHONPATH=. poetry run pytest
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'mysql' (-3)")
Everything is working on the local machine. How to do this correctly in GitHub Actions?
The text was updated successfully, but these errors were encountered:
It was necessary to create the database separately.
Sorry, something went wrong.
No branches or pull requests
What are you trying to do?
conftest.py:
Runtime environment
github_actions.yml
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'mysql' (-3)")
Everything is working on the local machine. How to do this correctly in GitHub Actions?
The text was updated successfully, but these errors were encountered: