Skip to content

Commit c3a2b24

Browse files
Merge pull request #292 from tillahoffmann/fix-mysql
Fix mysql environment variable test.
2 parents 5d93399 + ee3c3f8 commit c3a2b24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mysql/tests/test_mysql.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44
from testcontainers.core.utils import is_arm
55
from testcontainers.mysql import MySqlContainer
6+
from unittest import mock
67

78

89
@pytest.mark.skipif(is_arm(), reason='mysql container not available for ARM')
@@ -23,11 +24,10 @@ def test_docker_run_mariadb():
2324
assert row[0].startswith('10.6.5')
2425

2526

26-
@pytest.mark.skipif(is_arm(), reason='mysql container not available for ARM')
2727
def test_docker_env_variables():
28-
container = MySqlContainer("mariadb:10.6.5")\
29-
.with_bind_ports(3306, 32785).maybe_emulate_amd64()
30-
with container:
28+
with mock.patch.dict("os.environ", MYSQL_USER="demo", MYSQL_DATABASE="custom_db"), \
29+
MySqlContainer("mariadb:10.6.5").with_bind_ports(3306, 32785).maybe_emulate_amd64() \
30+
as container:
3131
url = container.get_connection_url()
3232
pattern = r'mysql\+pymysql:\/\/demo:test@[\w,.]+:(3306|32785)\/custom_db'
3333
assert re.match(pattern, url)

0 commit comments

Comments
 (0)