From a0d10c2d4c7803db1333a6e409e153e43e5a6e05 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 12 Jan 2018 09:47:32 -0500 Subject: [PATCH] Improve test framework... test_pyenvlib.py: get list of python versions from xdis main.py: bump okay_files appropriately when --verify is off --- test/test_pyenvlib.py | 21 ++++++++++++--------- uncompyle6/main.py | 3 +++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/test/test_pyenvlib.py b/test/test_pyenvlib.py index 2c0284c9..206141aa 100755 --- a/test/test_pyenvlib.py +++ b/test/test_pyenvlib.py @@ -21,22 +21,25 @@ Step 2: Run the test: from __future__ import print_function -from uncompyle6 import main, PYTHON3 -import os, time, shutil, sys +import os, time, re, shutil, sys from fnmatch import fnmatch +from uncompyle6 import main, PYTHON3 +import xdis.magics as magics + #----- configure this for your needs +python_versions = [v for v in magics.python_versions if + re.match('^[0-9.]+$', v)] + +# FIXME: we should remove Python versions that we don't support. +# These include Jython, and Python bytecode changes pre release. + TEST_VERSIONS=( 'pypy-2.4.0', 'pypy-2.6.1', 'pypy-5.0.1', 'pypy-5.3.1', 'pypy3.5-5.7.1-beta', - # FIXME: get this from xdis magics. - '2.3.7', '2.4.6', '2.5.6', '2.6.9', - '2.7.10', '2.7.11', '2.7.12', '2.7.13', '2.7.14', - '3.0.1', '3.1.5', '3.2.6', - '3.3.5', '3.3.6', '3.3.7', - '3.4.2', '3.5.3', '3.6.0', '3.6.3', '3.6.4', - 'native') + 'native') + tuple(python_versions) + target_base = '/tmp/py-dis/' lib_prefix = os.path.join(os.environ['HOME'], '.pyenv/versions') diff --git a/uncompyle6/main.py b/uncompyle6/main.py index 141eefce..2695ae21 100644 --- a/uncompyle6/main.py +++ b/uncompyle6/main.py @@ -196,6 +196,9 @@ def main(in_base, out_base, files, codes, outfile=None, raise pass pass + pass + else: + okay_files += 1 pass elif do_verify: sys.stderr.write("\n### uncompile successful, but no file to compare against\n")