Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automatically use mysqld-ram server if available.
import sys
if sys.argv[1] == "test":
import psutil
def mysqld_ram_running():
return any('mysqld-ram.sh' in ' '.join(p.cmdline) for p in psutil.get_process_list())
if mysqld_ram_running():
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'djangotests',
'USER': 'tester',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'PORT': '3307',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.