Package: polytester
Polytester is a simple, groovy multi-language test runner.It makes it easy to run tests in your polygot projects.  Run python, javascript, ruby, java, and more side by side.  It abstracts away the pain and config and lets you just get get developing. Easily.Polytester Just Works with any testing framework that runs in the shell (yo, that's pretty much everything on the planet), and ships with extra-smooth integration for lots of common frameworks including django, karma, protractor, and more.
Polytester was built bySteven Skoczen.Installationpip install polytesterGetting startedCreate a tests.yml file. The following example shows django, protractor, and karma (jasmine) tests.api:
    command: python manage.py test
js:
    command: karma start karma.conf.js
e2e:
    command: protractorRunpolytester$ polytester
Detecting...
  ✔ api detected as django tests.
  ✔ e2e detected as protractor tests.
  ✔ js detected as karma tests.
Running tests...
  ✔ api - 35 tests passed.
  ✔ e2e - 17 tests passed.
  ✔ js - 23 tests passed.

✔ All tests passed.Note that the status code returned is correct, so you can just dump this on your CI service, and be done.That's it. There is no step 3.Because everyone loves animated gifsHere's the above - polytester installed, configured, and running in less than 30 seconds:Supported FrameworksAny test framework that returns standard error codes will work out of the box.  That's pretty much everything.In addition, polytester progressively upgrades to extra-nice output for the frameworks it has parsers for. As of v1.0, the following parsers are built-in, and it's simple to write your own.  More are very much welcome via PR, and as youcan see below, writing them is easy!DjangoKarmaProtractorPython NosePython py.testPython unittestRspecSaladBut again, for extra clarity - if your test runner returns normal output codes, you can just drop it in and it'll work great.Command-line optionsRunning polytester.Polytester will respond toptorpolytester.  Both do the exact same thing.OptionsThere are a variety of options to make development simple.polytester fooorpolytester foo,barjust runs the test suite(s) specified.--autoreloador--ciwatches all files specified in awatch_glob, and immediately runs the relevant suite on file changes. Any running tests are killed.--wipruns tests flagged as "work in progress" by running thewip_commandfor all suites that specify it.--verboseor-vdumps all output to the shell.  To prevent collisions, when run in this mode, test suites are run in serial, instead of the normal parallel execution.--parallel n monly runs test chunknofm, for parallel build test environments.--config foo.ymlspecifies a different location for the config file.  Default istests.ymlAdvanced usageIf you want to get more out of polytester, there's more under the surface, including wip, autoreload, pass/fail counts, custom frameworks, and more.Here's all the goodness.AutoreloadHaving your tests auto-run when files change is super-handy.  With polytester, it's simple.Specify awatch_glob(and optionally awatch_dir) in yourtests.ymlpython: 
    command: nosetests
    watch_glob: "*.py"
    watch_dir: apiRun with--autoreloadpolytester--autoreloadAny time you change a file that matches the glob, polytester will immediately run the matching test suite.  Any running tests for that suite will be immediately killed.Notes:Ifwatch_diris not specified, it defaults to the current directory.To specify multiple file types, you can use standard unix globs, i.e.*.html;*.js;*.css.Running with--autoreloadwill only run the tests that have awatch_globin their config.  Which makes sense once you think about it, but might suprise you at first glance.Autoreload in action:WIP (Work in Progress) testsBeing able to tag and run certain groups of tests becomes a huge develoment time-saver for larger codebases. Polytester makes it simple.   Just specify awip_command, and run with--wip.Specify awip_commandin yourtests.ymlpython: 
    command: nosetests
    wip_command: nosetests -a wipRun with--wippolytester--wipThat's it!Parallel ExecutionIf you're running on a ci platform with parallel builds, likeCircleCI, the--paralleloption can save you some time.Just set up your build config to use it, and pass in the appropriate shell variables.For CircleCI, just set yourcircle.ymlto:test:
  override:
    - polytester --parallel $CIRCLE_NODE_INDEX $CIRCLE_NODE_TOTAL:
        parallel: trueAnd you're all set.  Your test suites will split out automatically, according to the number of build containers you have.Specifying test frameworksIf you're using the default test command for any supported frameworks, polytester just detects the right one, and you're on your way.  However, if you're using a custom runner, or something a bit special, you can easily just specify which parser polytester should use.Let's say for reasons too complex to explain, I have a custom wrapper around my nose script. No problem.  In mytests.yml, I just tell polytester to expect nose output.python: 
    command: my_custom_nose_script.sh
    parser: polytester.NoseParserNow, when you run, you get this output:$polytester
Detecting...✔pythonspecifiedasnosetests.

Runningtests...✔python:47testspassed.

✔Alltestspassed.Here's the full list of built-in parsers:DefaultParser(Just listens to exit codes, no support for number of tests.)NoseParserDjangoParserKarmaParserProtractorParserSaladParserIf you need a parser not in this list, you can make it by writing a few simple functions. SeeCustom parsersbelow.All optionsHere's a yml file, with everything, just for easy reference.:python: 
    command: nosetests
    wip_command: nosetests -a wip
    watch_glob: "*.py;*.html"  # Note you do need quotes because of the *.
    watch_dir: my_app/foo
    parser: my_parsers.MyNiftyCustomNoseParserWriting a Custom ParserAny test framework that returns standard error codes (0 for pass, non-zero for fail) will Just Work out of the box. However, if you want fancy test counts (and someday more), writing a custom parser is easy.Just write a class that inheritsDefaultParser, stick it somewhere on your python path, put in in yourtests.ymlfile, and you're good to go.  Here's an example for pep8.Please note:if you're writing for a common framework/use case, please submit a pull request!Write your own parser.my_parsers.pyfrompolytester.parsersimportDefaultParserclassMyCustomParser(DefaultParser):name="my custom"deftests_passed(self,result):# Required, the code below is the default in DefaultParserreturnresult.return_code==0defnum_failed(self,result):# Optional.m=re.match("(\d+) failed",result.output)returnint(m.group(0))defnum_passed(self,result):# Optional.returnself.num_total(result)-self.num_failed(result)defnum_total(self,result):# Optional.m=re.match("(\d+) total",result.output)returnint(m.group(0))defcommand_matches(self,command_string):# Optional, used for trying to auto-detect the test framework.# Since this is totally custom, we just return falsereturnFalseFor reference,resultsis an object with the following attributes:output- The stdout and stderr, in the order produced while running.cleaned_output-output, but stripped of all ANSI colors and escape codes.return_code- The return code.passed- A boolean indicating if the tests have passed.Noneuntil a definitive answer is known.parser- An instance of the parser class. (i.e. you can callresult.parser.num_failed(result)).Specify it in your test.yml file.custom: 
    command: run_tests.sh
    parser: my_parsers.MyCustomParserRun your tests like normal!$polytester
Detecting...✔customspecifiedasmycustomtests.

Runningtests...✔custom:18testspassed.

✔Alltestspassed.When things go wrong.When tests fail, polytester just falls back to the helpful output your test frameworks already give you:$ polytester
Detecting...
  ✔ api detected as django tests.
  ✔ e2e detected as karma tests.
  ✔ js detected as protractor tests.
Running tests...
  ✘ api - 1 of 35 tests failed.

    ======================================================================
    FAIL: test_addition (events.tests.SampleTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/me/project/events/tests.py", line 6, in test_addition
        self.assertEquals(1+1, 3)
    AssertionError: 2 != 3

    ----------------------------------------------------------------------
    Ran 35 tests in 1.642s

    FAILED (failures=1)

  ✔ e2e - 17 tests passed.
  ✔ js - 23 tests passed.

✘ Tests failedBuilt on the shoulders of giantsPolytester leverages some fantastic libraries.  It wouldn't exist without them.Clintfor all the nice shell output,Watchdogfor the magical file watching, andPyYAMLbecause nobody should have to think about parsing yaml files again.Polytester has also has had help from lots of coders. Alphabetically:brandoncazandergave you more robust ansi parsing across older versions of python.calebmeyergave you rspec support.joshfriendadded py.test support, and spotted a bug on python 2.7.x with--ci.jpulecfixed up karma test parsing for you.Releases1.2.2 - Feb 19, 2022Unpins requirements, adds newer python coverage to make resolutions with the new pip resolver easier.1.2.1 - March 12, 2015Improvements to karma test output parsing, thanks tojpulec.1.2.0 - March 6, 2015Pretty hefty rewrite of how the test runner and watch threads are handled, to fix the incompatabilities reported byalecklandgraf.1.1.3 - March 3, 2015Rspec parser, thanks tocalebmeyer.Improvements to ansi parsing across older versions of python, thanks tobrandoncazander.1.1.2 - Feb 5, 2015Bugfix to--cion python 3.4.1.1.1 - Jan 30, 2015Copypasta bugfix to django parser.1.1 - Jan 30, 2015The start of a test suite for polytester, thanks entirely tojoshfriend.Parser for the python unittest runner added byjoshfriend.Bugfix to nose parser, byjoshfriend.Fixed a bug in test output introduced by 1.0.2.  Thanks tojoshfriendfor the report.Noticing a pattern?  That pattern is that people likejoshfriendare what makes open-source awesome.All code now passes pep8.1.0.2 - Jan 30, 2015Adds support for py.test, thanks tojoshfriend.Fixes support for KeyboardInterrupts on python 2.7.x, thanks to the report byjoshfriend.1.0.1 - Jan 27, 2015Bugfix on --parallel.1.0 - Jan 27, 2015 - "Rick James"All RDD features in, we're using polytester in production.0.1.3 - Jan 22, 2015Everything but--ci,--failfast, and a couple parsers is in.0.1.2 - Jan 21, 2015Works on python 3. First stable release!0.1.1 - Jan 21, 2015Fixes inclusion of wsgiref, which breaks python 3 due to a print.0.1 - Jan 21, 2015Initial release.  Basic functionality works, only Django parser is in. Very much RDD.Into the FutureAs with all the open-source projects I run, I leave the future pretty open to what the people who use the project request, and the PRs that are sent.But here's a short list of things that are rolling around in my head as future features:Full test coverage.  We've got a good start, but 100% (or near) coverage with some integration tests is the long-term goal.Better parsing of test outputs, to just list failed test file names and line numbers or other fancy niceties.xUnit output--failfast, for super-quick iteration.The ability for parsers to do better parallelization introspection (based on globs, etc)Whatever great stuff you bring to the table!ContributingPRs Welcome!If you want to add support for a language or framework, those PRs arealwayswelcome.If you have a bigger idea, just pop open an issue, and we'll talk it through, so we don't cross wires when the PR comes!CultureAnyone is welcome to contribute to polytester, regardless of skill level or experience. To make polytester the best it can be, we have one big, overriding cultural principle:Be kind.Simple. Easy, right?We've all been newbie coders, we've all had bad days, we've all been frustrated with libraries, we've all spoken a language we learned later in life. In discussions with other coders, PRs, and CRs, we just give each the benefit of the doubt, listen well, and assume best intentions. It's worked out fantastically.This doesn't mean we don't have honest, spirited discussions about the direction to move polytester forward, or how to implement a feature. We do. We just respect one other while we do it. Not so bad, right? :)TestingAMakefileis included for your testing convenience. Here's a few sample commands:$ make test       # run the tests on the default python version (3.4)
$ make test-all   # run tests on all supported pythons (2.7, 3.3, 3.4)
$ make flake8     # run a pep8/pyflakes style/syntax check
$ make clean      # remove cached/compiled python test data
$ make clean-all  # rebuild the virtualenv from scratchTheMakefilewill take care of creating avirtualenvand installing the required dependencies (and keep them up to date).If you don't have all the supported versions of Python installed, don't worry! Push your changes to a branch, open a pull-request, andTraviswill run the tests on your behalf.