Skip to content

Commit 9f81e81

Browse files
Update docs and README.rst
* #45: features.rst, add 'HTTP Request' section * #45: features.rst, provide alternative, self contained example * #45: features.rst, remove dummy data * #45: features.rst, add newline at start of code example * #45: features.rst, reduce example syntax * add more project info badges * update .gitignore * move metadata to cfg file * apply pre-commit hooks * add link to contributing.rst to readme file * update docs * fix license filename * fix typo Co-authored-by: jeff levesque <[email protected]>
1 parent ab701b3 commit 9f81e81

File tree

7 files changed

+322
-227
lines changed

7 files changed

+322
-227
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ coverage.xml
2323
tests/junit.xml
2424

2525
pytest_flask/_version.py
26+
27+
# Editors
2628
.vscode
29+
.code-workspace

README.rst

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,61 @@
11
pytest-flask
22
============
33

4-
|PyPI version| |conda-forge version| |Python versions| |ci| |Documentation status|
4+
.. image:: https://img.shields.io/pypi/v/pytest-flask.svg
5+
:target: https://pypi.python.org/pypi/pytest-flask
6+
:alt: PyPi version
7+
8+
.. image:: https://img.shields.io/conda/vn/conda-forge/pytest-flask.svg
9+
:target: https://anaconda.org/conda-forge/pytest-flask
10+
:alt: conda-forge version
11+
12+
.. image:: https://github.com/pytest-dev/pytest-flask/workflows/build/badge.svg
13+
:target: https://github.com/pytest-dev/pytest-flask/actions
14+
:alt: CI status
15+
16+
.. image:: https://img.shields.io/pypi/pyversions/pytest-flask.svg
17+
:target: https://pypi.org/project/pytest-flask
18+
:alt: PyPi downloads
19+
20+
.. image:: https://readthedocs.org/projects/pytest-flask/badge/?version=latest
21+
:target: https://pytest-flask.readthedocs.org/en/latest/
22+
:alt: Documentation status
23+
24+
.. image:: https://img.shields.io/maintenance/yes/2020?color=blue
25+
:target: https://github.com/pytest-dev/pytest-flask
26+
:alt: Maintenance
27+
28+
.. image:: https://img.shields.io/github/last-commit/pytest-dev/pytest-flask?color=blue
29+
:target: https://github.com/pytest-dev/pytest-flask/commits/master
30+
:alt: GitHub last commit
31+
32+
.. image:: https://img.shields.io/github/issues-pr-closed-raw/pytest-dev/pytest-flask?color=blue
33+
:target: https://github.com/pytest-dev/pytest-flask/pulls?q=is%3Apr+is%3Aclosed
34+
:alt: GitHub closed pull requests
35+
36+
.. image:: https://img.shields.io/github/issues-closed/pytest-dev/pytest-flask?color=blue
37+
:target: https://github.com/pytest-dev/pytest-flask/issues?q=is%3Aissue+is%3Aclosed
38+
:alt: GitHub closed issues
39+
40+
.. image:: https://img.shields.io/pypi/dm/pytest-flask?color=blue
41+
:target: https://pypi.org/project/pytest-flask/
42+
:alt: PyPI - Downloads
43+
44+
.. image:: https://img.shields.io/github/languages/code-size/pytest-dev/pytest-flask?color=blue
45+
:target: https://github.com/pytest-dev/pytest-flask
46+
:alt: Code size
47+
48+
.. image:: https://img.shields.io/badge/license-MIT-blue.svg?color=blue
49+
:target: https://github.com/pytest-dev/pytest-flask/blob/master/LICENSE
50+
:alt: License
51+
52+
.. image:: https://img.shields.io/github/issues-raw/pytest-dev/pytest-flask.svg?color=blue
53+
:target: https://github.com/pytest-dev/pytest-flask/issues
54+
:alt: Issues
55+
56+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
57+
:target: https://github.com/ambv/black
58+
:alt: style
559

660
An extension of `pytest`_ test runner which
761
provides a set of useful tools to simplify testing and development
@@ -52,30 +106,11 @@ Contributing
52106
------------
53107

54108
Don’t hesitate to create a `GitHub issue`_ for any bug or
55-
suggestion.
56-
57-
.. |PyPI version| image:: https://img.shields.io/pypi/v/pytest-flask.svg
58-
:target: https://pypi.python.org/pypi/pytest-flask
59-
:alt: PyPi version
60-
61-
.. |conda-forge version| image:: https://img.shields.io/conda/vn/conda-forge/pytest-flask.svg
62-
:target: https://anaconda.org/conda-forge/pytest-flask
63-
:alt: conda-forge version
64-
65-
.. |ci| image:: https://github.com/pytest-dev/pytest-flask/workflows/build/badge.svg
66-
:target: https://github.com/pytest-dev/pytest-flask/actions
67-
:alt: CI status
68-
69-
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-flask.svg
70-
:target: https://pypi.org/project/pytest-flask
71-
:alt: PyPi downloads
72-
73-
.. |Documentation status| image:: https://readthedocs.org/projects/pytest-flask/badge/?version=latest
74-
:target: https://pytest-flask.readthedocs.org/en/latest/
75-
:alt: Documentation status
109+
suggestion. For more information check our contribution `guidelines`_.
76110

77111
.. _pytest: https://docs.pytest.org/en/stable/
78112
.. _PyPI: https://pypi.python.org/pypi/pytest-flask
79113
.. _Github issue: https://github.com/vitalk/pytest-flask/issues
80114
.. _package documentation: http://pytest-flask.readthedocs.org/en/latest/
115+
.. _guidelines: https://github.com/pytest-dev/pytest-flask/blob/master/CONTRIBUTING.rst
81116
.. _application factory: https://flask.palletsprojects.com/en/1.1.x/patterns/appfactories/

docs/contributing.rst

Lines changed: 99 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,113 @@
11
.. _contributing:
22

3-
Contributing
4-
============
3+
How to contribute
4+
=================
55

6-
Found a bug? Have an issue?
7-
---------------------------
6+
All contributions are greatly appreciated!
87

9-
The fastest way to get feedback on contributions/bugs is create a `GitHub
10-
issue`_ or catch me on `Twitter`_.
8+
How to report issues
9+
~~~~~~~~~~~~~~~~~~~~
1110

11+
Facilitating the work of potential contributors is recommended since it
12+
increases the likelihood of your issue being solved quickly. The few extra
13+
steps listed below will help clarify problems you might be facing:
1214

13-
Code syntax and conventions
14-
---------------------------
15+
- Include a `minimal reproducible example`_ when possible.
16+
- Describe the expected behaviour and what actually happened including a full
17+
trace-back in case of exceptions.
18+
- Make sure to list details about your environment, such as your platform,
19+
versions of pytest, pytest-flask and python release.
1520

16-
We try to conform to :pep:`8` as much as possible. Make sure that your code as
17-
well.
21+
Also, it's important to check the current open issues for similar reports
22+
in order to avoid duplicates.
1823

24+
.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
1925

20-
Where are the tests?
21-
--------------------
26+
Setting up your development environment
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2228

23-
Good that you’re asking. The repository test suite is located in ``tests``
24-
directory. Makefile defines a target to run them::
29+
- Fork pytest-flask to your GitHub account by clicking the `Fork`_ button.
30+
- `Clone`_ the main repository (not your fork) to your local machine.
2531

26-
make test
32+
.. code-block:: text
2733
28-
Ensure the all tests are passed before submitting a pull request.
34+
$ git clone https://github.com/pytest-dev/pytest-flask
35+
$ cd pytest-flask
2936
37+
- Add your fork as a remote to push your contributions.Replace
38+
``{username}`` with your username.
3039

31-
.. _GitHub issue: https://github.com/vitalk/pytest-flask/issues
32-
.. _Twitter: https://twitter.com/elephantscanfly
40+
.. code-block:: text
41+
42+
git remote add fork https://github.com/{username}/pytest-flask
43+
44+
- Using `Tox`_, create a virtual environment and install pytest-flask in editable mode with development dependencies.
45+
46+
.. code-block:: text
47+
48+
$ tox -e dev
49+
$ source venv/bin/activate
50+
51+
- Install pre-commit hooks
52+
53+
.. code-block:: text
54+
55+
$ pre-commit install
56+
57+
.. _Fork: https://github.com/pytest-dev/pytest-flask/fork
58+
.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork
59+
.. _Tox: https://tox.readthedocs.io/en/latest/
60+
61+
Start Coding
62+
~~~~~~~~~~~~
63+
64+
- Create a new branch to identify what feature you are working on.
65+
66+
.. code-block:: text
67+
68+
$ git fetch origin
69+
$ git checkout -b your-branch-name origin/master
70+
71+
- Make your changes
72+
- Include tests that cover any code changes you make and run them
73+
as described below.
74+
- Push your changes to your fork.
75+
`create a pull request`_ describing your changes.
76+
77+
.. code-block:: text
78+
79+
$ git push --set-upstream fork your-branch-name
80+
81+
.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request
82+
83+
How to run tests
84+
~~~~~~~~~~~~~~~~
85+
86+
You can run the test suite for the current environment with
87+
88+
.. code-block:: text
89+
90+
$ pytest
91+
92+
To run the full test suite for all supported python versions
93+
94+
.. code-block:: text
95+
96+
$ tox
97+
98+
Obs. CI will run tox when you submit your pull request, so this is optional.
99+
100+
Checking Test Coverage
101+
~~~~~~~~~~~~~~~~~~~~~~~
102+
103+
To get a complete report of code sections not being touched by the
104+
test suite run ``pytest`` using ``coverage``.
105+
106+
.. code-block:: text
107+
108+
$ coverage run -m pytest
109+
$ coverage html
110+
111+
Open ``htmlcov/index.html`` in your browser.
112+
113+
More about converage `here <https://coverage.readthedocs.io>`__.

0 commit comments

Comments
 (0)