0
Files
src/testing/test_env_test_script.py
Joshua Hood 3fade1f647 Reland "[CodeHealth] Migrate remainder of testing/ to Python3 compatible
syntax"

This is a reland of commit 8defc6c6da

Uses `sys.path.append(...)` to import the `common` module in
testing/scripts/run_variations_smoke_tests.py (as is done elsewhere in
the original CL) and resolve errors thrown for attempting a relative
import with no known parent package.

Original change's description:
>and Pylint2.7, and fix resulting errors.
>
>Bug: 1262363
>Change-Id: I09628427dd4caf9d873f3b489b897054430f8567
>Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557490
>Reviewed-by: Ben Pastene <bpastene@chromium.org>
>Commit-Queue: Joshua Hood <jdh@chromium.org>
>Cr-Commit-Position: refs/heads/main@{#996200}

Bug: 1262363
Change-Id: I60fe062f62962d0b3dc4e93d9e29626ed181f688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3610783
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Joshua Hood <jdh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999432}
2022-05-04 16:00:42 +00:00

24 lines
660 B
Python
Executable File

#!/usr/bin/env python
# Copyright (c) 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script for use in test_env unittests."""
from __future__ import print_function
import signal
import sys
import time
def print_signal(sig, *_args):
print('Signal :{}'.format(sig))
if __name__ == '__main__':
signal.signal(signal.SIGTERM, print_signal)
signal.signal(signal.SIGINT, print_signal)
if sys.platform == 'win32':
signal.signal(signal.SIGBREAK, print_signal) # pylint: disable=no-member
time.sleep(2) # gives process time to receive signal.