Skip to content

Commit 96cf752

Browse files
committed
Move mysql test from core to mysql package.
1 parent 79ac028 commit 96cf752

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

core/tests/test_new_docker_api.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
2-
import re
32
from pathlib import Path
43

5-
from testcontainers import mysql
64
from 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-
3322
def test_docker_kwargs():
3423
code_dir = Path(__file__).parent
3524
container_first = DockerContainer("nginx:latest")

mysql/tests/test_mysql.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import sqlalchemy
23
import pytest
34
from 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)

0 commit comments

Comments
 (0)