From 29d341e8107c9725c7fe7b9a536c9f5d5f055f84 Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Thu, 12 Nov 2015 12:19:41 -0800 Subject: [PATCH] Moved Python project guide to Project Team Guide This patch moves the python project guide from this documentation to the Project Team Guide, and adds an informative redirection link so existing bookmarks are not broken. Change-Id: I56b329d8a705b4d3cb88b5fcf509e423dc70e055 Depends-on: I39abdacebc0aaa60e393411acf3002195a480935 --- doc/source/developers.rst | 5 +- doc/source/python.rst | 108 ++------------------------------------ 2 files changed, 7 insertions(+), 106 deletions(-) diff --git a/doc/source/developers.rst b/doc/source/developers.rst index bda324c..d630f59 100644 --- a/doc/source/developers.rst +++ b/doc/source/developers.rst @@ -415,7 +415,8 @@ Running Unit Tests ------------------ Before submitting your change, you should test it. To learn how to run -python based unit tests in OpenStack projects see :ref:`python_unit_tests`. +python based unit tests in OpenStack projects see +`Running Python Unit Tests`_ Submitting a Change for Review ------------------------------ @@ -904,3 +905,5 @@ other repositories can be identified. Additional information about project gating and Zuul can be found in the Zuul documentation, located at: http://docs.openstack.org/infra/zuul/gating.html + +.. _`Running Python Unit Tests`: http://docs.openstack.org/project-team-guide/project-setup/python.html#running-python-unit-tests \ No newline at end of file diff --git a/doc/source/python.rst b/doc/source/python.rst index 2d5929f..fdc338f 100644 --- a/doc/source/python.rst +++ b/doc/source/python.rst @@ -2,110 +2,8 @@ Python Developer's Guide -######################### +######################## +This document has been moved to the `Project Team Guide: Python Project Guide`_. -The goal of this document is to explain OpenStack wide standard -practices around the use of Python. - -.. _python_unit_tests: - -Running Python Unit Tests -========================= - -Before submitting your change, you should test it. Repositories generally have -several categories of tests: - -* Style Checks -- Check source code for style issues -* Unit Tests -- Self contained in each repository -* Integration Tests -- Require a running OpenStack environment - -This section covers how to run the style check and unit tests. Both are run -through `Tox`_. - -.. _`Tox`: https://tox.readthedocs.org/en/latest/ - - -Install `pip`_:: - - [apt-get | yum] install python-pip - -Use pip to install tox:: - - pip install --upgrade tox - - -.. _`pip`: http://pip.readthedocs.org/en/latest/installing/ - -Run The Tests -^^^^^^^^^^^^^ - -Navigate to the repository's root directory and execute:: - - tox - -Note: completing this command may take a long time (depends on system resources), -also you might not see any output until tox is complete. - - -Run One Set of Tests -^^^^^^^^^^^^^^^^^^^^ - -Tox will run your entire test suite in the environments specified in the -repository tox.ini:: - - [tox] - - envlist = - -To run just one test suite in envlist execute:: - - tox -e - -so for example, run the test suite in py27:: - - tox -e py27 - - -Running the style checks -^^^^^^^^^^^^^^^^^^^^^^^^^ - -Just run:: - - tox -e pep8 - -Run One Test -^^^^^^^^^^^^ - -To run individual tests with tox: - -If `testr`_ is in tox.ini, for example:: - - [testenv] - - ... "python setup.py testr --slowest --testr-args='{posargs}'" - -Run individual tests with the following syntax:: - - tox -e -- path.to.module:Class.test - -So for example, run the test_memory_unlimited test in openstack/nova:: - - tox -e py27 -- nova.tests.unit.compute.test_claims.ClaimTestCase.test_memory_unlimited - -If `nose`_ is in tox.ini, for example:: - - [testenv] - - ... "nosetests {posargs}" - -Run individual tests with the following syntax:: - - tox -e -- --tests path.to.module:Class.test - -So for example, run the list test in openstack/swift:: - - tox -epy27 -- --tests test.unit.container.test_backend:TestContainerBroker.test_empty - -.. _`testr`: https://wiki.openstack.org/wiki/Testr -.. _`nose`: https://nose.readthedocs.org/en/latest/ +.. _`Project Team Guide: Python Project Guide`: http://docs.openstack.org/project-team-guide/project-setup/python.html