gemstone/tests/logging/check_output.py

23 lines
517 B
Python
Raw Normal View History

2024-05-02 06:26:18 +00:00
import subprocess
def run_logger_test():
p = subprocess.run("bin/tests/logging/output", capture_output=True, text=True)
# check exit code
if p.returncode != 0:
exit(p.returncode)
output = p.stderr
# check if logs appear in default log output (stderr)
assert "logging some debug..." in output
assert "logging some info..." in output
assert "logging some warning..." in output
assert "logging some error..." in output
if __name__ == "__main__":
run_logger_test()