Skip to content

Commit

Permalink
Print source on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Mar 21, 2021
1 parent 4c552f1 commit 43bdb98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hypothesis-python/tests/ghostwriter/test_ghostwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def get_test_function(source_code):
# Note that this also tests that the module is syntatically-valid,
# AND free from undefined names, import problems, and so on.
namespace = {}
exec(source_code, namespace)
try:
exec(source_code, namespace)
except NameError:
print(f"************\n{source_code}\n************")
raise
tests = [
v
for k, v in namespace.items()
Expand Down

0 comments on commit 43bdb98

Please sign in to comment.