diff options
author | Prabhu Ramachandran | 2017-04-27 17:28:44 +0530 |
---|---|---|
committer | GitHub | 2017-04-27 17:28:44 +0530 |
commit | a67f8597da19527669b596fab08083a18c7e1fcc (patch) | |
tree | 26484d05a23223df13aabb42fe674ce759e09187 /yaksh/evaluator_tests/test_scilab_evaluation.py | |
parent | ea9e60c47b763515b324aa507da06a1e91c488c6 (diff) | |
parent | 4a8f9a117f6a784fe722b8b381368c41be86024a (diff) | |
download | online_test-a67f8597da19527669b596fab08083a18c7e1fcc.tar.gz online_test-a67f8597da19527669b596fab08083a18c7e1fcc.tar.bz2 online_test-a67f8597da19527669b596fab08083a18c7e1fcc.zip |
Merge pull request #274 from maheshgudi/kill_stray_processes
Kill stray processes
Diffstat (limited to 'yaksh/evaluator_tests/test_scilab_evaluation.py')
-rw-r--r-- | yaksh/evaluator_tests/test_scilab_evaluation.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yaksh/evaluator_tests/test_scilab_evaluation.py b/yaksh/evaluator_tests/test_scilab_evaluation.py index 5a452a3..c3a1c83 100644 --- a/yaksh/evaluator_tests/test_scilab_evaluation.py +++ b/yaksh/evaluator_tests/test_scilab_evaluation.py @@ -3,13 +3,15 @@ import unittest import os import shutil import tempfile +from psutil import Process from textwrap import dedent + +#Local Import from yaksh import grader as gd from yaksh.grader import Grader from yaksh.scilab_code_evaluator import ScilabCodeEvaluator from yaksh.evaluator_tests.test_python_evaluation import EvaluatorBaseTest - class ScilabEvaluationTestCases(EvaluatorBaseTest): def setUp(self): tmp_in_dir_path = tempfile.mkdtemp() @@ -136,6 +138,11 @@ class ScilabEvaluationTestCases(EvaluatorBaseTest): self.assertFalse(result.get("success")) self.assert_correct_output(self.timeout_msg, result.get("error")) + parent_proc = Process(os.getpid()).children() + if parent_proc: + children_procs = Process(parent_proc[0].pid) + self.assertFalse(any(children_procs.children(recursive=True))) + if __name__ == '__main__': unittest.main() |