D John Anderson wrote: > The recorded scripts use asserts to do verification. This turns out to > be very convenient for development, because of our debugging > environment. We could implement another assert mechanism that does the > same thing assert does and is controlled by some other mechanism/command > line flag besides -O. That didn't seem worth the effort since we already > need to use asserts in the testing code and asserts are a well > established convention.
I think we should change the verification to something other than
asserts, then. Maybe something like (I'd have to look at the actual code
that currently does the verifications to know for sure...):
if Globals.options.recordedTest:
if test_condition_1 is False: raise AssertionError("test1 failed")
if test_condition_2 is False: raise AssertionError("test2 failed")
...
> If the reason you want to do the tests without -O is that you're worried
> about the side-effects introduced by asserts, then implementing another
> equivalent assert mechanism to run tests won't avoid side-effects of the
> same testing code.
Not just asserts, but if __debug__: sections introducing side-effects as
well. Also, running with -O changes timing which we also know to be a
thing that affects our tests.
--
Heikki Toivonen
signature.asc
Description: OpenPGP digital signature
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Open Source Applications Foundation "chandler-dev" mailing list http://lists.osafoundation.org/mailman/listinfo/chandler-dev
