Example #1
0
 def runPyflakes(self, paths, stdin=None):
     try:
         with SysStreamCapturing(stdin) as capture:
             main(args=paths)
     except SystemExit as e:
         return (capture.output, capture.error, e.code)
     else:
         raise RuntimeError("SystemExit not raised")
 def runPyflakes(self, paths, stdin=None):
     try:
         with SysStreamCapturing(stdin) as capture:
             main(args=paths)
     except SystemExit as e:
         return (capture.output, capture.error, e.code)
     else:
         raise RuntimeError('SystemExit not raised')
Example #3
0
 def runPyflakes(self, paths, stdin=None):
     try:
         with SysStreamCapturing(stdin) as capture:
             main(args=paths)
     except SystemExit as e:
         self.assertIsInstance(e.code, bool)
         rv = int(e.code)
         return (capture.output, capture.error, rv)
     else:
         raise RuntimeError("SystemExit not raised")
Example #4
0
 def runPyflakes(self, paths, stdin=None):
     try:
         with SysStreamCapturing(stdin) as capture:
             main(args=paths)
     except SystemExit as e:
         self.assertIsInstance(e.code, bool)
         rv = int(e.code)
         return (capture.output, capture.error, rv)
     else:
         raise RuntimeError('SystemExit not raised')
Example #5
0
from pyflakes.api import main

# python -m pyflakes
if __name__ == '__main__':
    main(prog='pyflakes')
from __future__ import print_function
import os
from pyflakes.api import main

def get_filenames():
    for dirpath, dirnames, filenames in os.walk("src"):
        if dirpath.endswith("__pycache__"):
            continue
        for rel_fn in filenames:
            if not rel_fn.endswith(".py"):
                continue
            fn = os.path.join(dirpath, rel_fn)
            if fn in [os.path.join("src", "header.py"),
                      os.path.join("src", "git", "long_header.py"),
                      ]:
                continue
            print("pyflakes on:", fn)
            yield fn

main(args=list(get_filenames()))
import os
from pyflakes.api import main


def get_filenames():
    for dirpath, dirnames, filenames in os.walk("src"):
        if dirpath.endswith("__pycache__"):
            continue
        for rel_fn in filenames:
            if not rel_fn.endswith(".py"):
                continue
            fn = os.path.join(dirpath, rel_fn)
            if fn in [
                    os.path.join("src", "header.py"),
                    os.path.join("src", "git", "long_header.py"),
            ]:
                continue
            print("pyflakes on:", fn)
            yield fn


main(args=list(get_filenames()))
Example #8
0
if __name__ == '__main__':
    import sys
    from pyflakes.api import main

    sys.exit(main())
from pyflakes.api import main

# python -m pyflakes
if __name__ == "__main__":
    main(prog="pyflakes")
Example #10
0
from pyflakes.api import main
# python -m pyflakes (with Python >= 2.7)
if __name__ == '__main__':
    main(prog='pyflakes')
Example #11
0
"""