summaryrefslogtreecommitdiff
path: root/yaksh/evaluator_tests/test_java_evaluation.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/evaluator_tests/test_java_evaluation.py')
-rw-r--r--yaksh/evaluator_tests/test_java_evaluation.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/yaksh/evaluator_tests/test_java_evaluation.py b/yaksh/evaluator_tests/test_java_evaluation.py
index 3d127af..2c49a50 100644
--- a/yaksh/evaluator_tests/test_java_evaluation.py
+++ b/yaksh/evaluator_tests/test_java_evaluation.py
@@ -4,6 +4,9 @@ import os
import shutil
import tempfile
from textwrap import dedent
+from psutil import Process, pid_exists
+import time
+
# Local Import
from yaksh import grader as gd
@@ -158,6 +161,10 @@ class JavaAssertionEvaluationTestCases(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
@@ -398,6 +405,11 @@ class JavaStdIOEvaluationTestCases(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_only_stdout(self):
# Given