Menu

How to run only specific test methods?

2011-11-13
2013-03-15
  • Piotr Dobrogost

    Piotr Dobrogost - 2011-11-13

    Is it possible to configure 'Python unittest' run configuration which uses PyDev test runner so that only specific test methods are being run? If not is it possible using other test runners - Nose or Py.test?

     
  • Piotr Dobrogost

    Piotr Dobrogost - 2011-11-13

    Could http://stackoverflow.com/questions/3121107/is-test-suite-deprecated-in-pyunit/7368528#7368528 be the answer?

    In addition to Mark's answer, one more reason to build your own suite() is if you are dynamically building tests.

    Also, it took me a while to figure out how to get PyDev to pick up the suite and run it in the graphical test runner. The trick is to put in a method like so:

    def load_tests(loader, tests, pattern):
        return suite()
    

    Such a method gets picked up the graphical test runner.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.