2
from xx import * 

may be an anti-pattern for code (though not necessarily interactive use). But one of the uses of init.py is to specify my library exports. So of course I want to test it.

flake8 naturally reports errors:

F403 'from xx import *' used; unable to detect undefined names
F405 'roughly' may be undefined, or defined from star imports: xx.f

Simply disabling the warning seems heavy-handed, is there a better way? Ideally a way which lets flake8 do its job on subsequent tests?

I don't want to also add pylint as an additional process step: Make flake8 differentiate between undefined functions and star imports

Michael Grazebrook
  • 5,361
  • 3
  • 16
  • 18
  • 2
    perhaps test the contents of `__all__` instead of running a `*` import -- or use an inline `# noqa: F403` on the offending line? (disclaimer: current flake8 maintainer) – anthony sottile Sep 18 '20 at 16:33

0 Answers0