Skip to content

Commit

Permalink
Fix potential type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Jun 10, 2024
1 parent d77d095 commit e258ce2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tested/oracles/programmed.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ def _evaluate_programmed(
with _catch_output() as (stdout_, stderr_):
exec(f"__tested_test__result = {literal_function_call}", global_env)
result_ = cast(BooleanEvalResult | None, global_env["__tested_test__result"])
stdout_ = stdout_.getvalue()
stderr_ = stderr_.getvalue()
except Exception as e:
_logger.exception(e)
result_ = None
stdout_ = None
stderr_ = None
messages.append(

Check warning on line 129 in tested/oracles/programmed.py

View check run for this annotation

Codecov / codecov/patch

tested/oracles/programmed.py#L124-L129

Added lines #L124 - L129 were not covered by tests
ExtendedMessage(
description="The custom check oracle failed with the following exception:",
Expand All @@ -134,9 +138,6 @@ def _evaluate_programmed(
ExtendedMessage(description=tb, format="code", permission=Permission.STAFF)
)

stdout_ = stdout_.getvalue()
stderr_ = stderr_.getvalue()

if stdout_:
messages.append(
ExtendedMessage(
Expand Down

0 comments on commit e258ce2

Please sign in to comment.