Skip to content

Commit

Permalink
ENH: use argparse in UAT
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Jan 30, 2022
1 parent 6face80 commit 9a9d141
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion UAT.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
import argparse
import sys

import matplotlib as mpl
import mpl_gui as mg
from matplotlib.figure import Figure

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

parser = argparse.ArgumentParser(
description="User Acceptance Tests for mpl-gui.",
epilog=(
"This script runs through several scenarios and prints out prompts explaining the expected behavior. "
"The figures will need to be closed to continue the script. "
),
)
parser.add_argument(
"backend",
type=str,
help="The backend to use. Can be anything that `mpl.use` accepts",
)

args = parser.parse_args()
target = args.backend

_, target = sys.argv

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

0 comments on commit 9a9d141

Please sign in to comment.