{ "info": { "author": "Lucas Bourneuf", "author_email": "lucas.bourneuf@laposte.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Testing" ], "description": "# ASP test\n[pytest](https://docs.pytest.org) plugin to test ASP source code.\n\nThe principle is simple: you write inputs and outputs in a dedicated file, you run pytest,\npytest tells you which outputs are missing or unexpected.\n\n\n## Installation\n\n pip install pytest-asptest\n\nObviously, in order to run ASP, a solver must be installed. The only one handled for now is [clingo](https://github.com/potassco/clingo/releases)\nfrom [potassco labs](https://potassco.org).\n\n\n## simple example\nLet's consider `dumbasp.lp`, an ASP code we want to be tested:\n\n```asp\np(1..3).\nq(X): p(X).\n```\n\nWe want to test the rule in second line. We therefore put it into a block (consecutive lines without blank lines)\nand give it a tag, `rule-q`:\n\n```asp\np(1..3).\n\n% TEST: rule-q\nq(X): p(X).\n```\n\nNow we fill `test-rule-q.lp` with multiple tests:\n\n```asp\n% INPUT\n% empty test: no input, no output\n% INSATISFIABLE\n\n% INPUT\np(1).\n% OUTPUT\nq(1).\n% OUTPUT\nq(2). % This will lead to an error : there is no such answer set.\n```\n\nNow, we can run again asptest:\n\n pytest dumbasp.lp\n\nIt will report the testing process, indicating which tests are passed, and which are not.\n\nMore examples are available in the [Makefile](Makefile), or in [examples/](examples/)\n\n\n\n\n## features\n- multiple files support ; tags are shared\n- handle generation of multiple answer sets, and strict keyword\n\n### strict output\nBy default, the atoms given in output parts must be a *subset* of the atoms present in the answer set.\nHowever, if you want to explicitely give *all* atoms that must appear in a given answer set,\nyou can write `% STRICT OUTPUT` instead of `% OUTPUT` in the test file.\n\n### file uid\nThe file uid is given by default to all blocks of a file, and is the basename of the file.\nYou can therefore implement `test-queens.lp` to test all the blocks found in file `queens.lp`,\nwithout having to manually tag all your blocks with it.\n\n### CLI options\nasptest add one option to pytest: `--uid-tests-dir`, allowing user to give to asptest the directory in which the `test-*.lp` files are.\nFor instance, `pytest . -vv --uid-tests-dir asp-test` would allow you to test all ASP files in the current directory, using the test files in `asp-test/` dir.\n\n## TODO\n- auto include input code into output with flag *with-output* on OUTPUT lines in test files\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aluriak/pytest-asptest", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-asptest", "package_url": "https://pypi.org/project/pytest-asptest/", "platform": "", "project_url": "https://pypi.org/project/pytest-asptest/", "project_urls": { "Homepage": "https://github.com/aluriak/pytest-asptest" }, "release_url": "https://pypi.org/project/pytest-asptest/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "test Answer Set Programming programs", "version": "0.1.0" }, "last_serial": 3817158, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ef659673457df0eeb3f437adf7d2ae74", "sha256": "356b2a61fb965ff75bf32beba4a9588ddc5878ace6eb32265034d1d87d6fd9af" }, "downloads": -1, "filename": "pytest-asptest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ef659673457df0eeb3f437adf7d2ae74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7643, "upload_time": "2018-04-28T16:14:29", "url": "https://files.pythonhosted.org/packages/3a/5d/22d04e731b94695a1812668603c1d4b8f4771955f30848cca1c7615e472a/pytest-asptest-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef659673457df0eeb3f437adf7d2ae74", "sha256": "356b2a61fb965ff75bf32beba4a9588ddc5878ace6eb32265034d1d87d6fd9af" }, "downloads": -1, "filename": "pytest-asptest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ef659673457df0eeb3f437adf7d2ae74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7643, "upload_time": "2018-04-28T16:14:29", "url": "https://files.pythonhosted.org/packages/3a/5d/22d04e731b94695a1812668603c1d4b8f4771955f30848cca1c7615e472a/pytest-asptest-0.1.0.tar.gz" } ] }