2
1

base.py 836 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # See utils/checkpackagelib/readme.txt before editing this file.
  2. import re
  3. import os
  4. class _CheckFunction(object):
  5. def __init__(self, filename, url_to_manual):
  6. self.filename = filename
  7. self.url_to_manual = url_to_manual
  8. self.disable = re.compile(r"^\s*# check-package .*\b{}\b".format(self.__class__.__name__))
  9. def before(self):
  10. pass
  11. def check_line(self, lineno, text):
  12. pass
  13. def after(self):
  14. pass
  15. class _Tool(object):
  16. def __init__(self, filename):
  17. self.filename = filename
  18. def run(self):
  19. pass
  20. def hint(self):
  21. return ""
  22. def run_test_suite():
  23. import pytest
  24. return pytest.main(
  25. # Disable writing/loading a cache with: -p no:cacheprovider
  26. ["-v", "-p", "no:cacheprovider", os.path.dirname(__file__)]
  27. )