Correct execution of test suite on Windows which doesn't support UTF-8 by

default.
This commit is contained in:
Anthony Tuininga 2017-01-16 15:20:14 -07:00
parent 4ad590ebc9
commit 7bf8ae65ca
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Module for testing string variables."""
class TestStringVar(BaseTestCase):

View File

@ -91,7 +91,10 @@ for name in moduleNames:
setattr(module, "TestCase", unittest.TestCase)
setattr(module, "BaseTestCase", BaseTestCase)
setattr(module, "cx_Oracle", cx_Oracle)
exec(open(fileName).read(), module.__dict__)
if sys.version_info[0] >= 3:
exec(open(fileName, encoding = "UTF-8").read(), module.__dict__)
else:
execfile(fileName, module.__dict__)
tests = loader.loadTestsFromModule(module)
result = runner.run(tests)
if not result.wasSuccessful():