From 3cf21e6edc14e8431a0a65867a45df35aef1911e Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Tue, 29 Oct 2019 00:25:59 -0700 Subject: [PATCH] bugfix: make `spack -d test test_changed_files` work (#13229) The `test_changed_files` in `test/cmd/flake8.py` was failing because it calls `ArgumentParser.parse_args()` without arguments. Normally that would just parse `sys.argv` but it seems to fail because of something in either `spack test` or `pytest`. Call it with an empty array so that it doesn't try to touch`sys.argv` at all. - [x] allow `-d` spack option for `test_changed_files` --- lib/spack/spack/test/cmd/flake8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/test/cmd/flake8.py b/lib/spack/spack/test/cmd/flake8.py index b95db93364..6cad6950ba 100644 --- a/lib/spack/spack/test/cmd/flake8.py +++ b/lib/spack/spack/test/cmd/flake8.py @@ -45,7 +45,7 @@ def flake8_package(): def test_changed_files(parser, flake8_package): - args = parser.parse_args() + args = parser.parse_args([]) # changed_files returns file paths relative to the root # directory of Spack. Convert to absolute file paths.