Skip to content

Commit 83fcab2

Browse files
committed
Use '--initialize-insecure' to prevent creation of a password. Ensure '--defaults-file' is called first (by necessity). In the test, don't try to connect to some default MySQL server but actually use the server created. Fixes #29.
1 parent 1beba4b commit 83fcab2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pytest_services/mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def mysql_system_database(
5656
services_log.debug('Starting mysqld.')
5757
check_output([
5858
mysqld,
59-
'--initialize',
6059
'--defaults-file={0}'.format(mysql_defaults_file),
60+
'--initialize-insecure',
6161
'--datadir={0}'.format(mysql_data_dir),
6262
'--basedir={0}'.format(mysql_base_dir),
6363
'--user={0}'.format(os.environ['USER'])

tests/test_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def test_memcached(request, memcached, memcached_socket):
1717
assert mc.get('some') is None
1818

1919

20-
def test_mysql(mysql, mysql_connection):
20+
def test_mysql(mysql, mysql_connection, mysql_socket):
2121
"""Test mysql service."""
22-
conn = MySQLdb.connect(user='root')
22+
conn = MySQLdb.connect(unix_socket=mysql_socket)
2323
assert conn
2424

2525

0 commit comments

Comments
 (0)