Error while trying to send test results through email
Hello,
Maybe this is not a Sikuli problem but a Python one, so sorry if question is misplaced! Here is my problem :
I have written a script that runs a suite of 4 test cases, creates Test Results with HTML Test Runner and puts results in a file. Fine till here. Then I am using a function found in python takes the file as an attachment and sends it through email :
def sendMail(to, subject, text, files=[
assert type(to)==list
assert type(files)==list
fro = "Test Name <email address hidden>"
msg = MIMEMultipart()
msg['From'] = fro
msg['To'] = COMMASPACE.join(to)
msg['Date'] = formatdate(
msg['Subject'] = subject
msg.attach( MIMEText(text) )
for file in files:
part = MIMEBase(
smtp = smtplib.
smtp.
smtp.close()
sendMail(["<email address hidden>
The problem is that when the function runs I get the below error :
assert type(to)==list
TypeError: type(): 1st arg can't be coerced to String
Why can't it take "<email address hidden>" as a String? Any suggestions?
Thank you!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Giota Tas for more information if necessary.