{ "info": { "author": "Xavier Morel", "author_email": "xavier.morel@masklinn.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "QUnitSuite is a ``unittest.TestSuite`` able to run QUnit_ test suites\nwithin the normal unittest process, through PhantomJS_.\n\nQUnitSuite is built upon `Ben Alman`_'s work of for the interfacing\nbetween PhantomJS_ and the host/reporting code: the shims and the\nPhantomJS_ configuration files are those of grunt_'s ``qunit`` task.\n\nWhy\n---\n\nYou're a Python shop or developer, you have tools and tests built\naround unittest (or compatible with unittests) and your testing\npipeline is predicated upon that, you're doing web development of some\nsort these days (as so many are) and you'd like to do some testing of\nyour web stuff.\n\nBut you don't really want to redo your whole testing stack just for\nthat.\n\nQUnitSuite simply grafts QUnit_-based tests, run in PhantomJS_, in\nyour existing ``unittest``-based architecture.\n\nWhat\n----\n\nQUnitSuite currently provides a single object as part of its API:\n``qunitsuite.QUnitSuite(testfile[, timeout])``.\n\nThis produces a ``unittest.TestSuite`` suitable for all the usual\nstuff (running it, and giving it to an other test suite which will run\nit, that is).\n\n``testfile`` is the HTML file bootstrapping your qunit tests, as would\nusually be accessed via a browser. It can be either a local\n(``file:``) url, or an HTTP one. As long as a regular browser can open\nand execute it, PhantomJS_ will manage.\n\n``timeout`` is a check passed to the PhantomJS_ runner: if the runner\nproduces no information for longer than ``timeout`` milliseconds, the\nrun will be cancelled and a test error will be generated. This\nsituation usually means either your ``testfile`` is not a qunit test\nfile, qunit is not running or qunit's runner was stopped (for an async\ntest) and never restarted.\n\nThe default value is very conservative, most tests should run\ncorrectly with lower timeouts (especially if all tests are\nsynchronous).\n\nHow\n---\n\n``unittest``'s autodiscovery protocol does not directly work with test\nsuites (it looks for test cases). If you want autodiscovery to work\ncorrectly, you will have to use the ``load_tests`` protocol::\n\n # in a testing module\n def load_tests(loader, tests, pattern):\n tests.addTest(QUnitSuite(qunit_test_path.html))\n return tests\n\noutside of that specific case, you can use a ``QUnitSuite`` as a\nstandard ``TestSuite`` instance, running it, adding it to an other\nsuite or passing it to a ``TestRunner``\n\nComplaints and Grievances\n-------------------------\n\nSpeed\n~~~~~\n\nStarting up a phantomjs instance and running a suite turns out to have\na rather high overhead, on the order of a second on this machine\n(2.4GHz, 8GB RAM and an SSD).\n\nAs each ``QUnitSuite`` currently creates its own phantomjs instance,\nit's probably a good idea to create bigger suites (put many modules &\ntests in the same QUnit html file, which doesn't preclude splitting\nthem across multiple js files).\n\nHacks\n~~~~~\n\nQUnitSuite contains a pretty big hack which may or may not cause\nproblem depending on your exact setup: in case of case failure or\nerror, ``unittest.TestResult`` formats the error traceback provided\nalongside the test object. This goes through Python's\ntraceback-formatting code and there are no hooks there.\n\nOne could expect to use a custom ``TestResult``, but for test suites\nthe ``TestResult`` instance must be provided by the caller, so there\nis no direct hook onto it.\n\nThis leaves three options:\n\n* Create a custom ``TestResult`` class and require that it be the one\n provided to the test suite. This requires altered work flows,\n customization of the test runner and (as far as I know) isn't\n available through Python 2.7's autodiscovery. It's the cleanest\n option but completely fails on practicality.\n\n* Create a custom ``TestResult`` which directly alters the original\n result's ``errors`` and ``failures`` attributes as they're part of\n the testrunner API. This would work but may put custom results in a\n strange state and break e.g. unittest2's ``@failfast``.\n\n* Lastly, monkeypatch the undocumented and implementation detail\n ``_exc_info_to_string`` on the provided ``result``. This is the\n route taken, at least for now.\n\n.. _QUnit: http://qunitjs.com/\n\n.. _PhantomJS: http://phantomjs.org/\n\n.. _Ben Alman: http://benalman.com/\n\n.. _grunt: http://gruntjs.com/\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "QUnitSuite", "package_url": "https://pypi.org/project/QUnitSuite/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/QUnitSuite/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/QUnitSuite/0.3/", "requires_dist": null, "requires_python": null, "summary": "unittest TestSuite integrating a QUnit javascript suite into a unittest flow", "version": "0.3" }, "last_serial": 785463, "releases": { "0.1": [ { "comment_text": "built for Darwin-10.8.0", "digests": { "md5": "c68137b533c3aa8a52cd0b1806b0d99b", "sha256": "11053501acf1293bdc0a10cacb84e2bdd02577f3d9c440eb982dee6d4eaf18d0" }, "downloads": -1, "filename": "QUnitSuite-0.1.macosx-10.6-x86_64.tar.gz", "has_sig": false, "md5_digest": "c68137b533c3aa8a52cd0b1806b0d99b", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 7975, "upload_time": "2012-11-06T11:56:40", "url": "https://files.pythonhosted.org/packages/c6/46/fa79dd28f7e9b6feee55b89129c886eb032d60fd393eab8d4e50e57da6d5/QUnitSuite-0.1.macosx-10.6-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "a0610f399f494044a3ff273eb6acffda", "sha256": "5c670eca54d901f1f9b409acaceae41e95f45147705dd07d9b0fcd77f6cb5eb1" }, "downloads": -1, "filename": "QUnitSuite-0.1.tar.gz", "has_sig": false, "md5_digest": "a0610f399f494044a3ff273eb6acffda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22086, "upload_time": "2012-10-30T13:29:38", "url": "https://files.pythonhosted.org/packages/d9/12/96ed6c09797f66989f6fe9f884dfe6ea0fdb7188cca20d24564de0f91d6e/QUnitSuite-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "90b763689f0ad4d63b2e18472e76f65d", "sha256": "38b99a7a45cbbe6bfe6ae06eccdafd2a53c871bd49ec47c3153fa37f12d3655b" }, "downloads": -1, "filename": "QUnitSuite-0.2.tar.gz", "has_sig": false, "md5_digest": "90b763689f0ad4d63b2e18472e76f65d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22673, "upload_time": "2012-11-06T11:57:40", "url": "https://files.pythonhosted.org/packages/2c/05/e560ebf8b8ba4c8b1e575a26fbbaca5bd40ef74d326242ae8010ae162611/QUnitSuite-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "f23dc7ab38ae1c8f22c069e68c30bf51", "sha256": "339ae286d1b767025435031c47397940f0d0959581b5d9b2b9c05e65ec711706" }, "downloads": -1, "filename": "QUnitSuite-0.3.tar.gz", "has_sig": false, "md5_digest": "f23dc7ab38ae1c8f22c069e68c30bf51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23315, "upload_time": "2012-11-16T10:53:04", "url": "https://files.pythonhosted.org/packages/cb/95/4bb76127fd4980ee3a8e7aba3a257c5ae2e0aebf252a00125c8ffafd8a69/QUnitSuite-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f23dc7ab38ae1c8f22c069e68c30bf51", "sha256": "339ae286d1b767025435031c47397940f0d0959581b5d9b2b9c05e65ec711706" }, "downloads": -1, "filename": "QUnitSuite-0.3.tar.gz", "has_sig": false, "md5_digest": "f23dc7ab38ae1c8f22c069e68c30bf51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23315, "upload_time": "2012-11-16T10:53:04", "url": "https://files.pythonhosted.org/packages/cb/95/4bb76127fd4980ee3a8e7aba3a257c5ae2e0aebf252a00125c8ffafd8a69/QUnitSuite-0.3.tar.gz" } ] }