Thanks for you response. > This has nothing to do with Django packages. It will fail for any > package where the main module does not match the (upstream) package > name. > > This import test is also the very minimal testing that can be done in a > python package. If you care enough about testing to not just delete the > `Testsuite: autopkgtest-pkg-python` field in debian/control, you might > as well enable real tests on the package instead.
I'm sorry but I do not understand, debian/control does not have a Testsuite field. Anyway I managed to workaround the autopkgtest failure in sbuild by adding a fixed debian/tests/source file to my source package. I had not tried that because the manual page of autodep8 says it prepends that file with its own output and I thought the failure due to the module naming would not go away. However, it seems my fixed tests replaced the generated ones. Maybe the manual page can be improved in this regard. Thanks, Alex