python3

The test suite should run on debuild

The package also ships DEP-8 tests, which mostly re-run the testsuite.

The network tests often rely on local certificatest that may have expires, sync them from upstream if necessary.

To run a single test file before building/installing a new version:

PYTHONPATH=Lib python3 Lib/test/test_xmlrpc.py

If the Python C code was modified:

PYTHONPATH=Lib LD_LIBRARY_PATH=build-shared \
  build-shared/python Lib/test/test_unicode.py

Before validating a patch, ensure that tests did fail before the patch (otherwise the vulnerability might need a different backport, or may not affect the version you’re working on, or maybe the new tests aren’t run at all):

# only keep the new tests
quilt diff | filterdiff -p1 -x 'Lib/test/*' | patch -p1 -R
# should fail
<test>
# revert to full patch
quilt diff -z | patch -p1 -R
# should pass
<test>

Some other distros repos: OpenSUSE, Fedora.

Salsa issue: Salsa sets PYTHONIOENCODING: utf-8 (MR), you may need to unexport PYTHONIOENCODING before running tests in debian/rules and autopkgtests.

Copyright (C) 2020, 2024, 2026 Sylvain Beucler