A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 regels
561 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. EarwigBot's Unit Test Support
  4. This module provides some support code for unit tests.
  5. Importing this module will "fix" your path so that EarwigBot code from bot/
  6. can be imported normally. The run() function runs a given test case.
  7. """
  8. from os import path
  9. import sys
  10. import unittest
  11. root = path.join(path.split(path.dirname(path.abspath(__file__)))[0], "bot")
  12. sys.path.insert(0, root)
  13. def run(case):
  14. suite = unittest.TestLoader().loadTestsFromTestCase(case)
  15. text_runner = unittest.TextTestRunner(verbosity=2).run(suite)