From 1f4771dfef069b85722a07636a97e8d7dd6ae6a2 Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Thu, 3 Oct 2013 12:50:34 -0300 Subject: [PATCH] Allow tests to be run from any directory. --- pymysql/tests/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymysql/tests/base.py b/pymysql/tests/base.py index f940962..dafd1de 100644 --- a/pymysql/tests/base.py +++ b/pymysql/tests/base.py @@ -9,7 +9,7 @@ except ImportError: class PyMySQLTestCase(unittest.TestCase): # You can specify your test environment creating a file named # "databases.json" or editing the `databases` variable below. - fname = "pymysql/tests/databases.json" + fname = os.path.join(os.path.dirname(__file__), "databases.json") if os.path.exists(fname): with open(fname) as f: databases = json.load(f)