summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/grader.py3
-rw-r--r--yaksh/python_assertion_evaluator.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py
index d81470b..9bc4e5c 100644
--- a/yaksh/grader.py
+++ b/yaksh/grader.py
@@ -156,7 +156,8 @@ class Grader(object):
del tb_list[1:3]
error.append(
prettify_exceptions(
- exc_type.__name__, str(exc_value), "".join(tb_list), line_no=line_no
+ exc_type.__name__, str(exc_value), "".join(tb_list),
+ line_no=line_no
)
)
finally:
diff --git a/yaksh/python_assertion_evaluator.py b/yaksh/python_assertion_evaluator.py
index 1f2b82b..4b016a1 100644
--- a/yaksh/python_assertion_evaluator.py
+++ b/yaksh/python_assertion_evaluator.py
@@ -39,7 +39,6 @@ class PythonAssertionEvaluator(BaseEvaluator):
submitted = compile(self.user_answer, '<string>', mode='exec')
self.exec_scope = {}
exec(submitted, self.exec_scope)
- exec("from nose.tools import *", self.exec_scope)
return self.exec_scope
def check_code(self):
@@ -67,6 +66,7 @@ class PythonAssertionEvaluator(BaseEvaluator):
success = False
mark_fraction = 0.0
try:
+ exec("from nose.tools import *", self.exec_scope)
_tests = compile(self.test_case, '<string>', mode='exec')
exec(_tests, self.exec_scope)
except TimeoutException: