[#1871] Fix tests

PEP9 and skip the get table names tests if running on legacy mode.