Fixing failing tests in test_automodapi

This PR fixes test in test_automodapi which were failing after the recent changes in ``automodapi`` (#2370).