@@ -10,3 +10,31 @@ def test_conflict_set():
|
||||
assert cs.check(read(0, key)) == [Result.CONFLICT]
|
||||
cs.setOldestVersion(1)
|
||||
assert cs.check(read(0, key)) == [Result.TOO_OLD]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# budget "pytest" for ctest integration without pulling in a dependency. You can of course still use pytest in local development.
|
||||
import argparse
|
||||
import inspect
|
||||
import sys
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(dest="command")
|
||||
|
||||
list_parser = subparsers.add_parser("list")
|
||||
test_parser = subparsers.add_parser("test")
|
||||
test_parser.add_argument("test")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.command == "list":
|
||||
sys.stdout.write(
|
||||
";".join(
|
||||
name[5:]
|
||||
for name in dir()
|
||||
if name.startswith("test_")
|
||||
and inspect.isfunction(getattr(sys.modules[__name__], name))
|
||||
)
|
||||
)
|
||||
elif args.command == "test":
|
||||
globals()["test_" + args.test]()
|
||||
|
Reference in New Issue
Block a user