[BUG] python -O bzr selftest fails
Aaron Bentley
aaron.bentley at utoronto.ca
Sat Oct 29 20:26:12 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John A Meinel wrote:
> https://launchpad.net/products/bzr/+bug/3685
>
> In summary, because python -O turns off assert statements, not all
> commands are run in the test suite. There are several lines with "assert
> <something>" where <something> has a side effect.
This feels like one of those "Doctor, it hurts when I do this" "So stop
doing that" situations. Yes, we can turn assert into something else,
but -O -O will still kill us hard, because we require docstrings to
exist (e.g. in BzrNewError).
I'm inclined to do:
assersions_work = False
try:
assert False
except:
assertions_work = True
if not assertions_work:
raise BzrCommandError("Bzr selftest cannot be executed with -O")
It just seems dumb to me that we have built-in language support for
assertions, but we can't use them where they're most convenient.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDY8zT0F+nu1YWqI0RAoHoAJ9ENPP4fUBIfunKdiwRbIPM2vhvoACfTSU4
2JcZmRnXwJmzZW1/CovvO8c=
=XS6w
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list