summaryrefslogtreecommitdiff
path: root/yaksh/python_assertion_evaluator.py
diff options
context:
space:
mode:
authoradityacp2018-04-06 16:21:12 +0530
committeradityacp2018-04-06 16:53:01 +0530
commita3e540aa209be57318de6c3e2548c56e68fdeded (patch)
tree1db29481917b56f7c0c1d5d8c7b02536e876d1e6 /yaksh/python_assertion_evaluator.py
parentc9aeb7b7e1484229782f0f8ab397890b27cfc905 (diff)
downloadonline_test-a3e540aa209be57318de6c3e2548c56e68fdeded.tar.gz
online_test-a3e540aa209be57318de6c3e2548c56e68fdeded.tar.bz2
online_test-a3e540aa209be57318de6c3e2548c56e68fdeded.zip
Change in grader.py and python_assertion_evaluator.py
- Make pep8 change in grader.py - Add nose tools in the scope during check_code instead of compile_code
Diffstat (limited to 'yaksh/python_assertion_evaluator.py')
-rw-r--r--yaksh/python_assertion_evaluator.py2
1 files changed, 1 insertions, 1 deletions
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: