我正在尝试使用名为TestBlbMktData
的unittest模块。请参阅下面的模块。它通过函数调用许多模块来测试它们是否正常工作我有一个函数定义。我在第13行有一个SyntaxError : invalid syntax
def print(self,data):
如果有人能让我知道如何解决这个问题,我将非常感激。
import unittest
import os.path
from dao.iotools.blbmktdata import *
class TestBlbMktData(unittest.TestCase):
staticName='Static.csv'
reportingName='Reporting.csv'
corpName='Actions.csv'
fxName='PER.csv'
holidayName='Holidays.csv'
closeDataName='ELB.csv'
def print(self,data):
print()
print(len(data))
print(data.head())
print(data.dtypes)
def read(self,name,func):
return func(os.path.join(self.current_dir,name))
def setUp(self):
self.current_dir=os.path.dirname(os.path.abspath(__file__))
def test_corp_act(self):
self.print(self.read(self.corpName,readCorpAction))
def test_static(self):
self.print(self.read(self.staticName,readInstrumentStatic))
def test_reporting(self):
self.print(self.read(self.reportingName,readReportingDates))
def test_fx(self):
self.print(self.read(self.fxName,readFx))
def test_holidays(self):
self.print(self.read(self.holidayName,readHolidays))
def test_close(self):
self.print(self.read(self.closeDataName,readClosePrice))
我正在运行的python版本是2.7.13
由于