diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-09-16 10:39:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 10:39:07 +0200 |
commit | abb0f6e27c45758c37fd45d663214b86413fb4f6 (patch) | |
tree | cf0969277a2aa750eed57ddff2980aa06b553c7b /lib | |
parent | 3fe9b343621fcb53f17b574e8258045dc607384b (diff) | |
download | spack-abb0f6e27c45758c37fd45d663214b86413fb4f6.tar.gz spack-abb0f6e27c45758c37fd45d663214b86413fb4f6.tar.bz2 spack-abb0f6e27c45758c37fd45d663214b86413fb4f6.tar.xz spack-abb0f6e27c45758c37fd45d663214b86413fb4f6.zip |
Fix NameError in foreground/background test (#25967)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/llnl/util/tty/log.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/test/llnl/util/tty/log.py b/lib/spack/spack/test/llnl/util/tty/log.py index a65073e657..78d4e24fa4 100644 --- a/lib/spack/spack/test/llnl/util/tty/log.py +++ b/lib/spack/spack/test/llnl/util/tty/log.py @@ -150,12 +150,13 @@ def test_log_subproc_and_echo_output_capfd(capfd, tmpdir): # def simple_logger(**kwargs): """Mock logger (minion) process for testing log.keyboard_input.""" + running = [True] + def handler(signum, frame): running[0] = False signal.signal(signal.SIGUSR1, handler) log_path = kwargs["log_path"] - running = [True] with log_output(log_path): while running[0]: print("line") @@ -343,6 +344,8 @@ def synchronized_logger(**kwargs): toggle output. It is used in ``test_foreground_background_output`` below. """ + running = [True] + def handler(signum, frame): running[0] = False signal.signal(signal.SIGUSR1, handler) @@ -351,7 +354,6 @@ def synchronized_logger(**kwargs): write_lock = kwargs["write_lock"] v_lock = kwargs["v_lock"] - running = [True] sys.stderr.write(os.getcwd() + "\n") with log_output(log_path) as logger: with logger.force_echo(): |