• Kirill Smelkov's avatar
    go/internal/xtesting: Prepare to run user's tests with both py2 and py3 · 613c489e
    Kirill Smelkov authored
    Tests, that want to verify something wrt both py2 and py3 will do
    WithEachPy(tested_func) which will run tested_func two times:
    
    1) under environment where python on $PATH points to python2, and
    2) under environment where python on $PATH points to python3.
    
    Client tests will now need to use just "python" instead of e.g.
    "python2" or "python3" to run some python program, and each time
    "python" will correspond to current phase of WithEachPy execution.
    
    This will be soon handy to test things wrt e.g. ZEO/py2 and ZEO/py3
    servers and similar situations.
    
    Tests that merely want to use some python program just for their inner
    working, for example to run `zodb commit`, no longer indicate their
    preference for py2. For such tests it is a matter of preference in
    pre-setup environment to where "python" points.
    
    For the reference under environments created with py2py3-venv(*) default
    "python" currently points to "python2".
    
    (*) see nexedi/zodbtools@fac2f190
    613c489e
xtesting.go 14 KB