File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
- import re
3
2
from pathlib import Path
4
3
5
- from testcontainers import mysql
6
4
from testcontainers .core .container import DockerContainer
7
5
8
6
@@ -21,15 +19,6 @@ def test_docker_custom_image():
21
19
assert int (port ) > 0
22
20
23
21
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
-
33
22
def test_docker_kwargs ():
34
23
code_dir = Path (__file__ ).parent
35
24
container_first = DockerContainer ("nginx:latest" )
Original file line number Diff line number Diff line change
1
+ import re
1
2
import sqlalchemy
2
3
import pytest
3
4
from testcontainers .core .utils import is_arm
@@ -20,3 +21,13 @@ def test_docker_run_mariadb():
20
21
result = e .execute ("select version()" )
21
22
for row in result :
22
23
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