Running a test with: res = pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc]) would fail with a MemoryError (likely from this chunk of code: rc = fill_conv_data(py_echo_off, py_echo_on, &conv_data); if (rc != 0) { PyMem_Free(test_list); PyErr_NoMemory(); return NULL; } Passing garbage, when the module tested doesn't need any pam data, such as the fingerprint reader PAM module, works around the problem: pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc], [ 'unused' ]) Tested using pam_wrapper-1.0.7-3.fc31.x86_64, but the current git seems to behave the same way.