Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

update test for run.py #21

Open
TaiSakuma opened this issue Jan 23, 2018 · 0 comments
Open

update test for run.py #21

TaiSakuma opened this issue Jan 23, 2018 · 0 comments

Comments

@TaiSakuma
Copy link
Member

TaiSakuma commented Jan 23, 2018

update test for run.py

  • to test SIGINT is actually ignored:
    signal.signal(signal.SIGINT, signal.SIG_IGN)
  • to test log level and handler are in effect:
    def setup_logging():
    path = 'logging_levels.json.gz'
    if not os.path.isfile(path):
    return
    with gzip.GzipFile(path, 'r') as f:
    loglevel_dict = json.loads(f.read().decode('utf-8'))
    for name, level in loglevel_dict.items():
    logger = logging.getLogger(name)
    logger.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    handler.setFormatter(formatter)
    logging.getLogger('').addHandler(handler)
@TaiSakuma TaiSakuma changed the title add a test to test SIGINT is actually ignored add a test to test SIGINT is actually ignored in run.py Feb 26, 2018
@TaiSakuma TaiSakuma changed the title add a test to test SIGINT is actually ignored in run.py update test for run.py Feb 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant