pyfec: execute tests on import of test_pyfec.py only if it is the __main__
authorzooko <zooko@zooko.com>
Sat, 27 Jan 2007 02:17:59 +0000 (07:47 +0530)
committerzooko <zooko@zooko.com>
Sat, 27 Jan 2007 02:17:59 +0000 (07:47 +0530)
darcs-hash:83c9116fa21d29b701a52bf8033dce3f95bde461

pyfec/fec/test/test_pyfec.py

index b01a3e64a59abf9ba073b6635f246ded7eca4bf1..00f59fba31b63eb81e95710454552eba30c4b66d 100755 (executable)
@@ -83,5 +83,7 @@ def test_random():
         _test_random()
         # sys.stdout.write(".")
     print "%d randomized tests pass." % (i+1)
-test_random()
+
+if __name__ == "__init__":
+    test_random()