[pacman-dev,2/7] pactest.py: read options from PACTEST_OPTS

Message ID 20210119183010.12831-2-andrew.gregory.8@gmail.com
State New
Headers show
Series [pacman-dev,1/7] pacman: add -w to -U | expand

Commit Message

Andrew Gregory Jan. 19, 2021, 6:30 p.m. UTC
Makes it easier to pass options when not running pactest directly.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
---
 test/pacman/pactest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py
index 20af41dc..c295bfc0 100755
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py
@@ -125,7 +125,8 @@  def create_parser():
 
     # parse options
     opt_parser = create_parser()
-    (opts, args) = opt_parser.parse_args()
+    (opts, args) = opt_parser.parse_args(args=os.getenv('PACTEST_OPTS', '').split())
+    (opts, args) = opt_parser.parse_args(values=opts)
 
     if args is None or len(args) == 0:
         tap.bail("no tests defined, nothing to do")