OxIonics / ionics_fits

Small python fitting library with an emphasis on Atomic Molecular and Optical Physics
Apache License 2.0
1 stars 0 forks source link

handle logging properly in pytest #14

Closed hartytp closed 1 year ago

hartytp commented 2 years ago
# parser = argparse.ArgumentParser()
# parser.add_argument(
#     "-v", "--verbose", default=0, action="count", help="increase logging level"
# )
# parser.add_argument(
#     "-q", "--quiet", default=0, action="count", help="decrease logging level"
# )
# args, _ = parser.parse_known_args()

# logging.getLogger().setLevel(logging.DEBUG)
# logger.setLevel(logging.WARNING + args.quiet * 10 - args.verbose * 10)

# handler = logging.StreamHandler(sys.stdout)
# handler.setLevel(logging.DEBUG)
# logger.addHandler(handler)
hartytp commented 2 years ago

semi-related This is probably fine as it is. I just thought I might point out that pytest has some integration with pythons warnings system: https://docs.pytest.org/en/7.1.x/how-to/capture-warnings.html