Skip to content

Commit

Permalink
Add more debugging for failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-quintero committed Nov 26, 2024
1 parent fb5dee9 commit 250a64c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/test_entrypoint/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ def test_entrypoint(self):
input_data = json.load(f)

input_stream = json.dumps(input_data)
print(input_stream)

main_file = self._file_name("main.py", self.TWO_DIRS_UP)
if os.path.exists(main_file):
print(f"main.py exists at {main_file}")
if os.path.getsize(main_file) == 0:
self.fail(f"{main_file} is empty.")

args = [sys.executable, main_file]
result = subprocess.run(
args,
env=os.environ,
check=True,
text=True,
capture_output=True,
input=input_stream,
)
try:
result = subprocess.run(
args,
env=os.environ,
check=True,
text=True,
capture_output=True,
input=input_stream,
)
except subprocess.CalledProcessError as e:
print("stderr:\n", e.stderr)
print("stdout:\n", e.stdout)
print("output:\n", e.output)
raise e

output = result.stdout

Expand Down

0 comments on commit 250a64c

Please sign in to comment.