test_security.py 601 B

12345678910111213141516171819
  1. from os import environ, path
  2. import subprocess
  3. import sys
  4. #This test is meant to be standalone, correct usage : python test_security.py file1 file2 file3 ...
  5. if __name__ == '__main__':
  6. HERE = path.dirname(__file__)
  7. if 'PYTHONPATH' not in environ:
  8. environ['PYTHONPATH'] = HERE
  9. else:
  10. environ['PYTHONPATH'] += ':' + HERE
  11. command = ['pylint', '--rcfile=/dev/null', '--disable=all', '--output-format', 'json', '--enable=non-const-markup', '--reports=n', '--load-plugins=_odoo_checker_markup', *sys.argv[1:]]
  12. proc = subprocess.run(command, env=environ, check=True)