Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 389fbf5b03e5bd58c548d8ef16468ccaa76a485b)
+++ tests/pybin/settings.py	(revision 4b30318b65b60547a35b2929b276b3f16467707c)
@@ -141,5 +141,5 @@
 	all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
 	archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
-	invariant    = options.no_invariant
+	invariant    = options.invariant
 	continue_    = options.continue_
 	dry_run      = options.dry_run # must be called before tools.config_hash()
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 389fbf5b03e5bd58c548d8ef16468ccaa76a485b)
+++ tests/test.py	(revision 4b30318b65b60547a35b2929b276b3f16467707c)
@@ -114,6 +114,6 @@
 	parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
 	parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
-	parser.add_argument('--invariant', help='Tell the compiler to check invariants.', action='store_true')
-	parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false')
+	parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false', dest='invariant')
+	parser.add_argument('--invariant', help='Tell the compiler to check invariants.', action='store_const', const=True)
 	parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180)
 	parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
