view tests/test-debugrename.t @ 27279:40eb385f798f

tests: add test for Python 3 compatibility Python 3 is inevitable. There have been incremental movements towards converting the code base to be Python 3 compatible. Unfortunately, we don't have any tests that look for Python 3 compatibility. This patch changes that. We introduce a check-py3-compat.py script whose role is to verify Python 3 compatibility of the files passed in. We add a test that calls this script with all .py files from the source checkout. The script currently only verifies that absolute_import and print_function are used. These are the low hanging fruits for Python compatbility. Over time, we can include more checks, including verifying we're able to load each Python file with Python 3. You have to start somewhere. Accepting this patch means that all new .py files must have absolute_import and print_function (if "print" is used) to avoid a new warning about Python 3 incompatibility. We've already converted several files to use absolute_import and print_function is in the same boat, so I don't think this is such a radical proposition.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 06 Dec 2015 22:39:12 -0800
parents 5d9bc49b0b1e
children 55c6ebd11cb9
line wrap: on
line source

  $ hg init
  $ echo a > a
  $ hg ci -Am t
  adding a

  $ hg mv a b
  $ hg ci -Am t1
  $ hg debugrename b
  b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3

  $ hg mv b a
  $ hg ci -Am t2
  $ hg debugrename a
  a renamed from b:37d9b5d994eab34eda9c16b195ace52c7b129980

  $ hg debugrename --rev 1 b
  b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3