Fixes for Python3 migration

pull/1606/head
CarstenAgerskov 2018-05-21 21:58:26 +02:00 committed by Matthew D. Scholefield
parent 1f630f6815
commit a353c43748
3 changed files with 7 additions and 11 deletions

View File

@ -23,8 +23,8 @@
must be installed (on Ubuntu: apt-get install python-tk)
"""
from Tkinter import Label, Button, Tk, NORMAL, END, DISABLED
import ScrolledText
from tkinter import Label, Button, Tk, NORMAL, END, DISABLED
from tkinter.scrolledtext import ScrolledText
import skill_tester
import ast
@ -47,19 +47,16 @@ class MessageTester:
def __init__(self, root):
root.title("Message tester")
Label(root, text="Enter message event below", bg="light green").pack()
self.event_field = ScrolledText.ScrolledText(root,
width=180, height=10)
self.event_field = ScrolledText(root, width=180, height=10)
self.event_field.pack()
Label(root, text="Enter test case below", bg="light green").pack()
self.test_case_field = ScrolledText.ScrolledText(root,
width=180, height=20)
self.test_case_field = ScrolledText(root, width=180, height=20)
self.test_case_field.pack()
Label(root, text="Test result:", bg="light green").pack()
self.result_field = ScrolledText.ScrolledText(root,
width=180, height=10)
self.result_field = ScrolledText(root, width=180, height=10)
self.result_field.pack()
self.result_field.config(state=DISABLED)
self.button = Button(root, text="Evaluate", fg="red",

View File

@ -77,10 +77,9 @@ class IntentTestSequenceMeta(type):
return type.__new__(mcs, name, bases, d)
class IntentTestSequence(unittest.TestCase):
class IntentTestSequence(unittest.TestCase, metaclass=IntentTestSequenceMeta):
"""This is the TestCase class that pythons unit tester can execute.
"""
__metaclass__ = IntentTestSequenceMeta
loader = None
@classmethod

View File

@ -243,7 +243,7 @@ class SkillTest(object):
cxt = test_case.get('set_context', None)
if cxt:
for key, value in cxt.iteritems():
for key, value in cxt.items():
MycroftSkill.set_context(s, key, value)
# Emit an utterance, just like the STT engine does. This sends the