Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (67 sloc) 2.53 KB
TESTSUITE
---------
The old testsuite is in the root directory, and runs through shell code.
- test_input contains all of the python code files to be checked.
- test_expected contains the expected output
- test_check.sh runs the testsuite
The new testsuite is in the test/ directory and uses the unittest module.
- test/test_input contains all of the python code files to be checked.
- test/test_expected contains the expected output
- test/ contains the unittest modules
- test/common.py contains common classes used in the unittest modules
- test/main.py is the main test loader
- run the testsuite either with:
PYTHONPATH=`pwd`:$PYTHONPATH python test/main.py
or
trial test
Adding a test:
- add a TestCase in test/test_(type).py
- add an input file in test/test_input/test_(name).py
- run the test to generate an expected output for this test
- adapt it, since it might not be what you want, if for example it generates
a warning that it shouldn't
UPDATE TO NEW PYTHON VERSION
----------------------------
- test/test_pychecker_CodeChecks has a test that fails on missing
opcode handlers for new opcodes
- add version codes to pychecker/utils.py (PYTHON_X_Y)
- compare pychecker/OP.py with opcodes:
- check/update the arrays for
cmp_op, hascompare, hasconst, hasfree, hasjabs, hasjrel, haslocal, hasname
- update some of the OP.py specific things:
- IS_CONDITIONAL_JUMP
- op checkers at the top
- add dispatchers for new opcodes in pychecker/CodeChecks.py
- see http://docs.python.org/library/dis.html
- figure out when they were added; in python source code:
svn blame Lib/opcode.py
svn diff -c [changeset that added/changed your opcode]
- add future keywords in pychecker/python.py
FINDING WARNINGS
----------------
If you want to know where a generated warning was triggered in the code:
- look for the string template in pychecker/msgs.py; find the capitaled
constant representing it
- grep for that string in the code
- use -d when running pychecker to see where during the processing that
warning was added
HISTORY
-------
- Python 2.7:
- changes:
LIST_APPEND moved from 18 to 94
BUILD_MAP to IMPORT_FROM bumped from 104-108 to 105-109
EXTENDED_ARG bumped from 143 to 145
- added:
BUILD_SET
JUMP_IF_FALSE/TRUE_OR_POP
POP_JUMP_IF_FALSE/TRUE
SET_ADD/MAP_ADD
- removed:
JUMP_IF_FALSE/JUMP_IF_TRUE
BUILDBOT
--------
A buildbot is set up at http://build.fluendo.com:8200/
PACKAGES
--------
- debian page: http://packages.qa.debian.org/p/pychecker.html