From 0bf24044765641cb86df7b464a3d8ee4428536bf Mon Sep 17 00:00:00 2001 From: Matthew Hughes Date: Sun, 23 May 2021 21:27:59 +0100 Subject: [PATCH] Fix ./runtests.py failing without any args Previously, running this script without args would result in an error: $ ./runtests.py Traceback (most recent call last): File "./runtests.py", line 49, in sys.exit(pytest.main(pytest_args)) NameError: name 'pytest_args' is not defined --- runtests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtests.py b/runtests.py index c340b55d8..98f34c067 100755 --- a/runtests.py +++ b/runtests.py @@ -45,5 +45,7 @@ if __name__ == "__main__": # `runtests.py TestCase [flags]` # `runtests.py test_function [flags]` pytest_args = ['tests', '-k', pytest_args[0]] + pytest_args[1:] + else: + pytest_args = [] sys.exit(pytest.main(pytest_args))