fortrangoingonforty/fortsh / 9e9c2a1

Browse files

force fresh session when test specifies custom env variables

Tests with env field (like MYVAR=testvalue for variable completion)
need a fresh PTY session to inherit the custom environment. On Linux
with tests_per_session=10, reused sessions don't have the custom env.
Authored by espadonne
SHA
9e9c2a1d941d41607ce298895a3382c995278dc7
Parents
816d375
Tree
13309f1

1 changed file

StatusFile+-
M tests/interactive/run_tests.py 1 0
tests/interactive/run_tests.pymodified
@@ -108,6 +108,7 @@ class YAMLTestRunner:
108108
         """
109109
         needs_new = (
110110
             fresh or
111
+            (env is not None and len(env) > 0) or  # Custom env requires fresh session
111112
             self._current_session is None or
112113
             not self._current_session.is_running or
113114
             self._test_count % self.tests_per_session == 0