|
|
|
@ -592,14 +592,14 @@ To run the Celery test suite you need to install
|
|
|
|
|
$ pip install -U -r requirements/default.txt |
|
|
|
|
|
|
|
|
|
After installing the dependencies required, you can now execute |
|
|
|
|
the test suite by calling :pypi:`py.test <pytest>`: |
|
|
|
|
the test suite by calling :pypi:`pytest <pytest>`: |
|
|
|
|
|
|
|
|
|
.. code-block:: console |
|
|
|
|
|
|
|
|
|
$ py.test t/unit |
|
|
|
|
$ py.test t/integration |
|
|
|
|
$ pytest t/unit |
|
|
|
|
$ pytest t/integration |
|
|
|
|
|
|
|
|
|
Some useful options to :command:`py.test` are: |
|
|
|
|
Some useful options to :command:`pytest` are: |
|
|
|
|
|
|
|
|
|
* ``-x`` |
|
|
|
|
|
|
|
|
@ -618,7 +618,7 @@ you can do so like this:
|
|
|
|
|
|
|
|
|
|
.. code-block:: console |
|
|
|
|
|
|
|
|
|
$ py.test t/unit/worker/test_worker.py |
|
|
|
|
$ pytest t/unit/worker/test_worker.py |
|
|
|
|
|
|
|
|
|
.. _contributing-coverage: |
|
|
|
|
|
|
|
|
@ -636,11 +636,11 @@ Installing the :pypi:`pytest-cov` module:
|
|
|
|
|
Code coverage in HTML format |
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
|
|
|
|
|
|
|
|
#. Run :command:`py.test` with the ``--cov-report=html`` argument enabled: |
|
|
|
|
#. Run :command:`pytest` with the ``--cov-report=html`` argument enabled: |
|
|
|
|
|
|
|
|
|
.. code-block:: console |
|
|
|
|
|
|
|
|
|
$ py.test --cov=celery --cov-report=html |
|
|
|
|
$ pytest --cov=celery --cov-report=html |
|
|
|
|
|
|
|
|
|
#. The coverage output will then be located in the :file:`htmlcov/` directory: |
|
|
|
|
|
|
|
|
@ -651,11 +651,11 @@ Code coverage in HTML format
|
|
|
|
|
Code coverage in XML (Cobertura-style) |
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
|
|
|
|
|
|
|
|
#. Run :command:`py.test` with the ``--cov-report=xml`` argument enabled: |
|
|
|
|
#. Run :command:`pytest` with the ``--cov-report=xml`` argument enabled: |
|
|
|
|
|
|
|
|
|
.. code-block:: console |
|
|
|
|
|
|
|
|
|
$ py.test --cov=celery --cov-report=xml |
|
|
|
|
$ pytest --cov=celery --cov-report=xml |
|
|
|
|
|
|
|
|
|
#. The coverage XML output will then be located in the :file:`coverage.xml` file. |
|
|
|
|
|
|
|
|
@ -828,7 +828,7 @@ make it easier for the maintainers to accept your proposed changes:
|
|
|
|
|
``Needs Test Coverage``. |
|
|
|
|
|
|
|
|
|
- [ ] Make sure unit test coverage does not decrease. |
|
|
|
|
``py.test -xv --cov=celery --cov-report=xml --cov-report term``. |
|
|
|
|
``pytest -xv --cov=celery --cov-report=xml --cov-report term``. |
|
|
|
|
You can check the current test coverage here: https://codecov.io/gh/celery/celery |
|
|
|
|
|
|
|
|
|
- [ ] Run ``flake8`` against the code. The following commands are valid |
|
|
|
|