Skip to content

Commit 8bc47fc

Browse files
committed
Log error information in test_examples.py
1 parent 2856d2f commit 8bc47fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

{{cookiecutter.package_name}}/tests/test_examples.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
suite.
44
"""
55

6+
import logging
67
import os
78
import shlex
89
import subprocess
@@ -74,7 +75,12 @@ def run_in_venv(
7475
try:
7576
subprocess.run(args, **popen_default_kwargs, check=True)
7677
return True
77-
except subprocess.CalledProcessError:
78+
except subprocess.CalledProcessError as error:
79+
logging.error("Error: %s", error)
80+
if error.stdout:
81+
logging.error("stdout: %s", error.stdout.decode())
82+
if error.stderr:
83+
logging.error("stderr: %s", error.stderr.decode())
7884
return False
7985
finally:
8086
os.chdir(original_cwd)

0 commit comments

Comments
 (0)