diff --git a/test/test.py b/test/test.py
index 65eaf189853c9f0ffc99fa8b3adf7a8d811c9f07..8a6996e1418af0aa97097c812a4e1487c8e98256 100644
--- a/test/test.py
+++ b/test/test.py
@@ -1,9 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 #
 # Test the given TP shell
 #
 # Author: David Gonzalez (HEPIA) <david.dg.gonzalez@hesge.ch>
+# Author: Guillaume Chanel <guillaume.chanel@unige.ch>
 
 import sys
 import tempfile
@@ -153,6 +154,9 @@ class Shell:
             raise subprocess.TimeoutExpired('The exit command did not exit the shell after {}s'.format(timeout))
         #TODO: should I check if process is still running at that point (stream closed but process alive ?)
 
+        if self.shell_process.returncode != 0:
+            raise AssertionError('Shell process exited with an error code ({})'.format(self.shell_process.returncode))
+
 
     def read_stdout(self):
         if self.stdout is not None: