Commits

Danilo Bellini committed 5eb8467

First commit. Plugin just has the option defined

Comments (0)

Files changed (5)

+The MIT License (MIT)
+
+Copyright (c) 2013
+Danilo de Jesus da Silva Bellini and Wille Marcel Lima Malheiro
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+include LICENSE.txt
+IPython testing for py.test
+===========================
+
+Uses the "--ipythondocs" option in the py.test to use it.
+IPython examples should be done in the docstrings.
+

pytest_ipythondocs.py

+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2013
+# Danilo de Jesus da Silva Bellini and Wille Marcel Lima Malheiro
+#
+# This is free software (MIT license). See LICENSE.txt for more details.
+# Created on Sat Oct 05 2013
+""" A py.test pluging to discover/run IPython-style tests in docstrings. """
+
+def pytest_addoption(parser):
+    group = parser.getgroup("collect")
+    group.addoption("--ipythondocs",
+        action="store_true", default=False,
+        help="run IPython docstring tests in all .py modules",
+        dest="ipythondocs")
+
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2013
+# Danilo de Jesus da Silva Bellini and Wille Marcel Lima Malheiro
+#
+# This is free software (MIT license). See LICENSE.txt for more details.
+# Created on Sat Oct 05 2013
+
+from setuptools import setup
+
+with open("README.rst") as f:
+    long_description = f.read()
+
+if __name__ == "__main__":
+    setup(
+        name="pytest-ipythondocs",
+        description="pytest plugin to check IPython tests inside docstrings",
+        long_description=long_description,
+        version="0.0.1",
+        author="Danilo de Jesus da Silva Bellini and " \
+               "Wille Marcel Lima Malheiro",
+        author_email="danilo.bellini@gmail.com ; wille@wille.blog.br",
+        url="",
+        py_modules=["pytest_ipythondocs"],
+        entry_points={"pytest11": ["ipythondocs = pytest_ipythondocs"]},
+    )
+