File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ def interactive_check(
22
22
) -> bool | None :
23
23
"""Ask a human to visually inspect a plot.
24
24
25
+ Note: `pytest` would capture output by default, and you would
26
+ need to pass `-s` to release capture.
27
+
28
+ Todo:
29
+ - scale figure size by display.
30
+ - possible to automatically release `pytest` capture?
31
+
25
32
Args:
26
33
plot (plt.Figure | plt.Axes): Plot to inspect.
27
34
elem_to_check (str): Prompt for what element in the plot to check.
@@ -57,11 +64,16 @@ def interactive_check(
57
64
58
65
# Ask the user to check (treat KeyboardInterrupt as "yes")
59
66
try :
60
- good_enough : bool = (
61
- input (f"Please check the { elem_to_check } . Is it looking good? (y/n): " )
62
- .strip ()
63
- .lower ()
64
- ) == "y"
67
+ current_test_name = os .environ .get ("PYTEST_CURRENT_TEST" , "" ).removesuffix (
68
+ "(call)"
69
+ )
70
+ print ( # noqa: T201 (print)
71
+ f"\n Currently checking: { current_test_name } "
72
+ f"\n Please check the '{ elem_to_check } '. " ,
73
+ end = "" ,
74
+ )
75
+
76
+ good_enough : bool = input ("Is it looking good? (y/n): " ).strip ().lower () == "y"
65
77
except KeyboardInterrupt :
66
78
good_enough = True
67
79
You can’t perform that action at this time.
0 commit comments