--- a/tests/hghave Sat Nov 16 11:59:22 2019 -0800
+++ b/tests/hghave Sat Nov 16 11:53:47 2019 -0800
@@ -13,11 +13,13 @@
checks = hghave.checks
+
def list_features():
for name, feature in sorted(checks.items()):
desc = feature[1]
print(name + ':', desc)
+
def test_features():
failed = 0
for name, feature in checks.items():
@@ -29,11 +31,15 @@
failed += 1
return failed
+
parser = optparse.OptionParser("%prog [options] [features]")
-parser.add_option("--test-features", action="store_true",
- help="test available features")
-parser.add_option("--list-features", action="store_true",
- help="list available features")
+parser.add_option(
+ "--test-features", action="store_true", help="test available features"
+)
+parser.add_option(
+ "--list-features", action="store_true", help="list available features"
+)
+
def _loadaddon():
if 'TESTDIR' in os.environ:
@@ -49,13 +55,16 @@
sys.path.insert(0, path)
try:
import hghaveaddon
+
assert hghaveaddon # silence pyflakes
except BaseException as inst:
- sys.stderr.write('failed to import hghaveaddon.py from %r: %s\n'
- % (path, inst))
+ sys.stderr.write(
+ 'failed to import hghaveaddon.py from %r: %s\n' % (path, inst)
+ )
sys.exit(2)
sys.path.pop(0)
+
if __name__ == '__main__':
options, args = parser.parse_args()
_loadaddon()