summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests/test_bash_evaluation.py
diff options
context:
space:
mode:
authormahesh2017-04-13 09:41:43 +0530
committermahesh2017-04-13 10:11:35 +0530
commit4ab90db99afafcf3d6ab91deeaf35e5f4874502b (patch)
tree139734db0d8a48bae48f44f9e602206738af8c00 /yaksh/evaluator_tests/test_bash_evaluation.py
parentde2a369a4908046eef41f01537fd39442e14365c (diff)
downloadonline_test-4ab90db99afafcf3d6ab91deeaf35e5f4874502b.tar.gz
online_test-4ab90db99afafcf3d6ab91deeaf35e5f4874502b.tar.bz2
online_test-4ab90db99afafcf3d6ab91deeaf35e5f4874502b.zip
added test case to check for stray processes
Diffstat (limited to 'yaksh/evaluator_tests/test_bash_evaluation.py')
-rw-r--r--yaksh/evaluator_tests/test_bash_evaluation.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/yaksh/evaluator_tests/test_bash_evaluation.py b/yaksh/evaluator_tests/test_bash_evaluation.py
index 482d45e..ee6949d 100644
--- a/yaksh/evaluator_tests/test_bash_evaluation.py
+++ b/yaksh/evaluator_tests/test_bash_evaluation.py
@@ -3,6 +3,8 @@ import unittest
import os
import shutil
import tempfile
+from psutil import Process, pid_exists
+# Local Imports
from yaksh.grader import Grader
from yaksh.bash_code_evaluator import BashCodeEvaluator
from yaksh.bash_stdio_evaluator import BashStdIOEvaluator
@@ -103,6 +105,12 @@ class BashAssertionEvaluationTestCases(EvaluatorBaseTest):
# Then
self.assertFalse(result.get("success"))
self.assert_correct_output(self.timeout_msg, result.get("error"))
+ parent_proc = Process(os.getpid()).children()
+ if parent_proc:
+ self.assertFalse(any(Process(parent_proc[0].pid)\
+ .children(recursive=True)))
+
+
def test_file_based_assert(self):
# Given