File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
2- import re
32from pathlib import Path
43
5- from testcontainers import mysql
64from testcontainers .core .container import DockerContainer
75
86
@@ -21,15 +19,6 @@ def test_docker_custom_image():
2119 assert int (port ) > 0
2220
2321
24- def test_docker_env_variables ():
25- container = mysql .MySqlContainer ("mariadb:10.6.5" )\
26- .with_bind_ports (3306 , 32785 ).maybe_emulate_amd64 ()
27- with container :
28- url = container .get_connection_url ()
29- pattern = r'mysql\+pymysql:\/\/demo:test@[\w,.]+:(3306|32785)\/custom_db'
30- assert re .match (pattern , url )
31-
32-
3322def test_docker_kwargs ():
3423 code_dir = Path (__file__ ).parent
3524 container_first = DockerContainer ("nginx:latest" )
Original file line number Diff line number Diff line change 1+ import re
12import sqlalchemy
23import pytest
34from testcontainers .core .utils import is_arm
@@ -20,3 +21,13 @@ def test_docker_run_mariadb():
2021 result = e .execute ("select version()" )
2122 for row in result :
2223 assert row [0 ].startswith ('10.6.5' )
24+
25+
26+ @pytest .mark .skipif (is_arm (), reason = 'mysql container not available for ARM' )
27+ def test_docker_env_variables ():
28+ container = MySqlContainer ("mariadb:10.6.5" )\
29+ .with_bind_ports (3306 , 32785 ).maybe_emulate_amd64 ()
30+ with container :
31+ url = container .get_connection_url ()
32+ pattern = r'mysql\+pymysql:\/\/demo:test@[\w,.]+:(3306|32785)\/custom_db'
33+ assert re .match (pattern , url )
You can’t perform that action at this time.
0 commit comments