diff --git a/test_helper/__init__.py b/test_helper/__init__.py index 742a0e7..5fc63fa 100644 --- a/test_helper/__init__.py +++ b/test_helper/__init__.py @@ -1 +1 @@ -from test_helper import Test +from .test_helper import Test diff --git a/test_helper/test_helper.py b/test_helper/test_helper.py index 0d4c8c5..b83a4b7 100644 --- a/test_helper/test_helper.py +++ b/test_helper/test_helper.py @@ -24,9 +24,9 @@ def assertTrue(cls, result, msg=""): cls.numTests += 1 if result == True: cls.passed += 1 - print "1 test passed." + print("1 test passed.") else: - print "1 test failed. " + msg + print("1 test failed. " + msg) if cls.failFast: if cls.private: raise PrivateTestFailure(msg) @@ -43,8 +43,8 @@ def assertEqualsHashed(cls, var, hashed_val, msg=""): @classmethod def printStats(cls): - print "{0} / {1} test(s) passed.".format(cls.passed, cls.numTests) + print("{0} / {1} test(s) passed.".format(cls.passed, cls.numTests)) @classmethod def _hash(cls, x): - return hashlib.sha1(str(x)).hexdigest() + return hashlib.sha1(str(x).encode('utf8')).hexdigest()