summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-31 09:55:01 -0700
committerEli Schwartz <eschwartz93@gmail.com>2021-08-31 16:28:54 -0400
commit4d7031437c7a81b52c776d4ae1e32741bdb851ca (patch)
tree7716c4af0d3f43b450a7c94dd42ae5dbef8ebdff /test cases
parent06fdb29daace9ebe55e5df5336f65cba304773d2 (diff)
downloadmeson-4d7031437c7a81b52c776d4ae1e32741bdb851ca.tar.gz
pylint: turn on superflous-parens
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/14 configure file/check_file.py2
-rwxr-xr-xtest cases/common/14 configure file/generator.py2
-rwxr-xr-xtest cases/common/49 custom target/my_compiler.py2
-rwxr-xr-xtest cases/common/71 ctarget dependency/gen2.py2
-rwxr-xr-xtest cases/common/86 private include/stlib/compiler.py2
-rw-r--r--test cases/frameworks/1 boost/test_python_module.py4
-rw-r--r--test cases/frameworks/7 gnome/resources/resources.py2
-rwxr-xr-xtest cases/unit/2 testsetups/envcheck.py2
-rw-r--r--test cases/unit/49 testsetup default/envcheck.py6
-rwxr-xr-xtest cases/unit/68 test env value/test.py2
-rwxr-xr-xtest cases/unit/91 devenv/test-devenv.py8
11 files changed, 17 insertions, 17 deletions
diff --git a/test cases/common/14 configure file/check_file.py b/test cases/common/14 configure file/check_file.py
index a96614702..7d96b2aec 100644
--- a/test cases/common/14 configure file/check_file.py
+++ b/test cases/common/14 configure file/check_file.py
@@ -14,7 +14,7 @@ def permit_osx_workaround(m1, m2):
return True
if len(sys.argv) == 2:
- assert(os.path.exists(sys.argv[1]))
+ assert os.path.exists(sys.argv[1])
elif len(sys.argv) == 3:
f1 = sys.argv[1]
f2 = sys.argv[2]
diff --git a/test cases/common/14 configure file/generator.py b/test cases/common/14 configure file/generator.py
index e3cc88101..832a7b872 100755
--- a/test cases/common/14 configure file/generator.py
+++ b/test cases/common/14 configure file/generator.py
@@ -11,7 +11,7 @@ subdir = Path(os.environ['MESON_SUBDIR'])
inputf = Path(sys.argv[1])
outputf = Path(sys.argv[2])
-assert(inputf.exists())
+assert inputf.exists()
with outputf.open('w') as ofile:
ofile.write("#define ZERO_RESULT 0\n")
diff --git a/test cases/common/49 custom target/my_compiler.py b/test cases/common/49 custom target/my_compiler.py
index 986911124..a32cbdbba 100755
--- a/test cases/common/49 custom target/my_compiler.py
+++ b/test cases/common/49 custom target/my_compiler.py
@@ -3,7 +3,7 @@
import os
import sys
-assert(os.path.exists(sys.argv[3]))
+assert os.path.exists(sys.argv[3])
args = sys.argv[:-1]
diff --git a/test cases/common/71 ctarget dependency/gen2.py b/test cases/common/71 ctarget dependency/gen2.py
index dc6525b9d..6fde55600 100755
--- a/test cases/common/71 ctarget dependency/gen2.py
+++ b/test cases/common/71 ctarget dependency/gen2.py
@@ -4,7 +4,7 @@ import sys, os
from glob import glob
files = glob(os.path.join(sys.argv[1], '*.tmp'))
-assert(len(files) == 1)
+assert len(files) == 1
with open(files[0]) as ifile, open(sys.argv[2], 'w') as ofile:
ofile.write(ifile.read())
diff --git a/test cases/common/86 private include/stlib/compiler.py b/test cases/common/86 private include/stlib/compiler.py
index c8597ddc1..7a2effae7 100755
--- a/test cases/common/86 private include/stlib/compiler.py
+++ b/test cases/common/86 private include/stlib/compiler.py
@@ -2,7 +2,7 @@
import sys, os
-assert(len(sys.argv) == 3)
+assert len(sys.argv) == 3
h_templ = '''#pragma once
unsigned int %s(void);
diff --git a/test cases/frameworks/1 boost/test_python_module.py b/test cases/frameworks/1 boost/test_python_module.py
index acf6e42d6..8ef96d2ff 100644
--- a/test cases/frameworks/1 boost/test_python_module.py
+++ b/test cases/frameworks/1 boost/test_python_module.py
@@ -19,9 +19,9 @@ def run():
w.set(msg)
- assert(msg == w.greet())
+ assert msg == w.greet()
version_string = str(sys.version_info[0]) + "." + str(sys.version_info[1])
- assert(version_string == w.version())
+ assert version_string == w.version()
if __name__ == '__main__':
run()
diff --git a/test cases/frameworks/7 gnome/resources/resources.py b/test cases/frameworks/7 gnome/resources/resources.py
index b351b04e6..0855ef744 100644
--- a/test cases/frameworks/7 gnome/resources/resources.py
+++ b/test cases/frameworks/7 gnome/resources/resources.py
@@ -7,4 +7,4 @@ if __name__ == '__main__':
Gio.Resource._register(res)
data = Gio.resources_lookup_data('/com/example/myprog/res1.txt', Gio.ResourceLookupFlags.NONE)
- assert(data.get_data() == b'This is a resource.\n')
+ assert data.get_data() == b'This is a resource.\n'
diff --git a/test cases/unit/2 testsetups/envcheck.py b/test cases/unit/2 testsetups/envcheck.py
index af39c4e23..e41a715a0 100755
--- a/test cases/unit/2 testsetups/envcheck.py
+++ b/test cases/unit/2 testsetups/envcheck.py
@@ -2,4 +2,4 @@
import os
-assert('PATH' in os.environ)
+assert 'PATH' in os.environ
diff --git a/test cases/unit/49 testsetup default/envcheck.py b/test cases/unit/49 testsetup default/envcheck.py
index 6ba3093ff..34ad76d4e 100644
--- a/test cases/unit/49 testsetup default/envcheck.py
+++ b/test cases/unit/49 testsetup default/envcheck.py
@@ -2,9 +2,9 @@
import os
-assert('ENV_A' in os.environ)
-assert('ENV_B' in os.environ)
-assert('ENV_C' in os.environ)
+assert 'ENV_A' in os.environ
+assert 'ENV_B' in os.environ
+assert 'ENV_C' in os.environ
print('ENV_A is', os.environ['ENV_A'])
print('ENV_B is', os.environ['ENV_B'])
diff --git a/test cases/unit/68 test env value/test.py b/test cases/unit/68 test env value/test.py
index 0cc7645e7..4adf62cdb 100755
--- a/test cases/unit/68 test env value/test.py
+++ b/test cases/unit/68 test env value/test.py
@@ -3,4 +3,4 @@
import os
import sys
-assert(os.environ['TEST_VAR'] == sys.argv[1])
+assert os.environ['TEST_VAR'] == sys.argv[1]
diff --git a/test cases/unit/91 devenv/test-devenv.py b/test cases/unit/91 devenv/test-devenv.py
index 4e5be9776..9f84f97e7 100755
--- a/test cases/unit/91 devenv/test-devenv.py
+++ b/test cases/unit/91 devenv/test-devenv.py
@@ -2,7 +2,7 @@
import os
-assert(os.environ['MESON_DEVENV'] == '1')
-assert(os.environ['MESON_PROJECT_NAME'] == 'devenv')
-assert(os.environ['TEST_A'] == '1')
-assert(os.environ['TEST_B'] == '1+2+3')
+assert os.environ['MESON_DEVENV'] == '1'
+assert os.environ['MESON_PROJECT_NAME'] == 'devenv'
+assert os.environ['TEST_A'] == '1'
+assert os.environ['TEST_B'] == '1+2+3'