You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix tox to test examples again
add detox tox env for faster testing
clean up makefile, add tox target
add extra group for installing dev requirements
clean up contributing doc, build with docs
expand issue template
add pull request template
Install Flask as an editable package using the current source::
87
-
88
-
cd flask
89
-
pip install --editable .
90
-
91
-
Running the testsuite
92
-
---------------------
93
-
94
-
The minimal requirement for running the testsuite is ``pytest``. You can
95
-
install it with::
96
-
97
-
pip install pytest
98
-
99
-
Then you can run the testsuite with::
100
-
101
-
pytest tests/
102
-
103
-
**Shortcut**: ``make test`` will ensure ``pytest`` is installed, and run it.
104
-
105
-
With only pytest installed, a large part of the testsuite will get skipped
106
-
though. Whether this is relevant depends on which part of Flask you're working
107
-
on. Travis is set up to run the full testsuite when you submit your pull
108
-
request anyways.
109
-
110
-
If you really want to test everything, you will have to install ``tox`` instead
111
-
of ``pytest``. You can install it with::
112
-
113
-
pip install tox
114
-
115
-
The ``tox`` command will then run all tests against multiple combinations
116
-
Python versions and dependency versions.
117
-
118
-
**Shortcut**: ``make tox-test`` will ensure ``tox`` is installed, and run it.
115
+
tox
119
116
120
117
Running test coverage
121
-
---------------------
122
-
Generating a report of lines that do not have unit test coverage can indicate where
123
-
to start contributing. ``pytest`` integrates with ``coverage.py``, using the ``pytest-cov``
124
-
plugin. This assumes you have already run the testsuite (see previous section)::
118
+
~~~~~~~~~~~~~~~~~~~~~
125
119
126
-
pip install pytest-cov
120
+
Generating a report of lines that do not have test coverage can indicate
121
+
where to start contributing. Run ``pytest`` using ``coverage`` and generate a
122
+
report on the terminal and as an interactive HTML document::
127
123
128
-
After this has been installed, you can output a report to the command line using this command::
124
+
coverage run -m pytest
125
+
coverage report
126
+
coverage html
127
+
# then open htmlcov/index.html
129
128
130
-
pytest --cov=flask tests/
129
+
Read more about `coverage <https://coverage.readthedocs.io>`_.
131
130
132
-
Generate a HTML report can be done using this command::
131
+
Running the full test suite with ``tox`` will combine the coverage reports
132
+
from all runs.
133
133
134
-
pytest --cov-report html --cov=flask tests/
134
+
``make`` targets
135
+
~~~~~~~~~~~~~~~~
135
136
136
-
Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io
137
+
Flask provides a ``Makefile`` with various shortcuts. They will ensure that
138
+
all dependencies are installed.
137
139
138
-
**Shortcut**: ``make cov`` will ensure ``pytest-cov`` is installed, run it, display the results, *and* save the HTML report.
140
+
- ``make test`` runs the basic test suite with ``pytest``
141
+
- ``make cov`` runs the basic test suite with ``coverage``
142
+
- ``make test-all`` runs the full test suite with ``tox``
143
+
- ``make docs`` builds the HTML documentation
139
144
145
+
Caution: zero-padded file modes
146
+
-------------------------------
140
147
141
-
Caution
142
-
=======
143
-
pushing
144
-
-------
145
-
This repository contains several zero-padded file modes that may cause issues when pushing this repository to git hosts other than github. Fixing this is destructive to the commit history, so we suggest ignoring these warnings. If it fails to push and you're using a self-hosted git service like Gitlab, you can turn off repository checks in the admin panel.
148
+
This repository contains several zero-padded file modes that may cause issues
149
+
when pushing this repository to git hosts other than GitHub. Fixing this is
150
+
destructive to the commit history, so we suggest ignoring these warnings. If it
151
+
fails to push and you're using a self-hosted git service like GitLab, you can
152
+
turn off repository checks in the admin panel.
146
153
147
-
148
-
cloning
149
-
-------
150
-
The zero-padded file modes files above can cause issues while cloning, too. If you have
151
-
152
-
::
154
+
These files can also cause issues while cloning. If you have ::
153
155
154
156
[fetch]
155
157
fsckobjects = true
156
158
157
-
or
158
-
159
-
::
159
+
or ::
160
160
161
161
[receive]
162
162
fsckObjects = true
163
163
164
-
165
-
set in your git configuration file, cloning this repository will fail. The only solution is to set both of the above settings to false while cloning, and then setting them back to true after the cloning is finished.
164
+
set in your git configuration file, cloning this repository will fail. The only
165
+
solution is to set both of the above settings to false while cloning, and then
166
+
setting them back to true after the cloning is finished.
0 commit comments