diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2012-01-27 14:16:20 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-01-27 14:16:20 -0500 |
commit | e13613436c2aa402a041a069ad0f0ca1c0bf16a3 (patch) | |
tree | 31e65dd10c8b3ae860a8dda8c6542e781dddc087 | |
parent | f6062b8d4322827f80f5d40e0ab4c1cb4e9c2275 (diff) | |
download | pytest-runner-e13613436c2aa402a041a069ad0f0ca1c0bf16a3.tar.gz |
Expanded documentation
-rw-r--r-- | command.py | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -19,13 +19,17 @@ class PyTest(_pytest_runner_test.test): ] def initialize_options(self): - self.junitxml=None - self.extras=False + self.junitxml = None + self.extras = False def finalize_options(self): pass def run(self): + """ + Override run to ensure requirements are available in this session (but + don't install them anywhere). + """ if self.distribution.install_requires: self.distribution.fetch_build_eggs(self.distribution.install_requires) if self.distribution.tests_require: @@ -39,6 +43,9 @@ class PyTest(_pytest_runner_test.test): self.with_project_on_sys_path(self.run_tests) def run_tests(self): + """ + Override run_tests to invoke pytest. + """ import pytest import sys # hide command-line arguments from pytest.main @@ -51,9 +58,14 @@ class PyTest(_pytest_runner_test.test): @classmethod def install(cls, setup_params): + """ + Given a dictionary of keyword parameters to be passed to setup(), + update those parameters with tests_require and cmdclass to make + pytest available. + """ reqs = setup_params.setdefault('tests_require', []) if not any('pytest' in req for req in reqs): - reqs.extend(['pytest>=2.1.2',]) + reqs.extend(['pytest>=2.1.2']) setup_params.setdefault('cmdclass', {}).update( test=cls, ) |