Skip to content

Commit 9a9d141

Browse files
committed
ENH: use argparse in UAT
1 parent 6face80 commit 9a9d141

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

UAT.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
import argparse
12
import sys
23

34
import matplotlib as mpl
45
import mpl_gui as mg
56
from matplotlib.figure import Figure
67

8+
# ensure no pyplot!
79
assert sys.modules.get("matplotlib.pyplot", None) is None
810
sys.modules["matplotlib.pyplot"] = None
911

12+
parser = argparse.ArgumentParser(
13+
description="User Acceptance Tests for mpl-gui.",
14+
epilog=(
15+
"This script runs through several scenarios and prints out prompts explaining the expected behavior. "
16+
"The figures will need to be closed to continue the script. "
17+
),
18+
)
19+
parser.add_argument(
20+
"backend",
21+
type=str,
22+
help="The backend to use. Can be anything that `mpl.use` accepts",
23+
)
24+
25+
args = parser.parse_args()
26+
target = args.backend
1027

11-
_, target = sys.argv
1228

1329
# this is how to force the right Qt binding
1430
if target.lower().startswith("qt5"):

0 commit comments

Comments
 (0)