@@ -33,17 +33,27 @@ you frustration.
33
33
Getting the code
34
34
----------------
35
35
36
- The coverage.py code is hosted on a GitHub repository at
37
- https://github.com/nedbat/coveragepy. To get a working environment, follow
38
- these steps:
36
+ Fork the repo into your own github repository. If you have not forked a
37
+ repository before then please follow the `fork instructions `_ provided by
38
+ github.
39
+
40
+ .. _fork instructions : https://docs.github.com/en/get-started/quickstart/fork-a-repo
41
+
42
+ The coverage.py code will then be copied into a GitHub repository at
43
+ https://github.com/GITHUB_USER/coveragepy where GITHUB_USER is your github
44
+ username. To get a working development environment, follow these steps:
39
45
40
46
.. minimum of PYVERSIONS:
41
47
42
- #. Create a Python 3.7 virtualenv to work in, and activate it.
48
+ #. Create a virtualenv using one of the common virtualenv formats (conda,
49
+ venv, pipenv, etc) and a version of python greater than 3.7 to work in, and
50
+ activate it. Please follow your virtualenv format specific creation and
51
+ activation instructions.
52
+
43
53
44
54
#. Clone the repository::
45
55
46
- $ git clone https://github.com/nedbat /coveragepy
56
+ $ git clone https://github.com/GITHUB_USER /coveragepy
47
57
$ cd coveragepy
48
58
49
59
#. Install the requirements::
@@ -54,20 +64,23 @@ these steps:
54
64
``dev.in`` instead::
55
65
56
66
$ python3 -m pip install -r requirements/dev.in
67
+
68
+ Note: You may need to upgrade pip to install the requirements.
57
69
58
- #. Install a number of versions of Python. Coverage.py supports a range
59
- of Python versions. The more you can test with, the more easily your code
60
- can be used as-is. If you only have one version, that's OK too, but may
61
- mean more work integrating your contribution.
70
+ #. (Optional) Install more versions of Python. By default, Coverage.py won't
71
+ run the tests on a version of python that isn't installed. Coverage.py
72
+ supports a range of Python versions. The more you can test with, the more
73
+ easily your code can be used as-is. If you only have one version, that's
74
+ OK too, but may mean more work integrating your contribution.
62
75
63
76
64
77
Running the tests
65
78
-----------------
66
79
67
80
The tests are written mostly as standard unittest-style tests, and are run with
68
- pytest running under `tox `_::
81
+ pytest running under `tox `_ by using the command ` python3 -m tox ` ::
69
82
70
- % tox
83
+ % python3 -m tox
71
84
ROOT: tox-gh won't override envlist because tox is not running in GitHub Actions
72
85
.pkg: _optional_hooks> python /usr/local/virtualenvs/coverage/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
73
86
.pkg: get_requires_for_build_editable> python /usr/local/virtualenvs/coverage/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
@@ -113,21 +126,21 @@ the second uses the Python implementation.
113
126
114
127
To limit tox to just a few versions of Python, use the ``-e `` switch::
115
128
116
- $ tox -e py37,py39
129
+ $ python3 -m tox -e py37,py39
117
130
118
131
On the tox command line, options after ``-- `` are passed to pytest. To run
119
132
just a few tests, you can use `pytest test selectors `_::
120
133
121
- $ tox -- tests/test_misc.py
122
- $ tox -- tests/test_misc.py::HasherTest
123
- $ tox -- tests/test_misc.py::HasherTest::test_string_hashing
134
+ $ python3 -m tox -- tests/test_misc.py
135
+ $ python3 -m tox -- tests/test_misc.py::HasherTest
136
+ $ python3 -m tox -- tests/test_misc.py::HasherTest::test_string_hashing
124
137
125
138
These commands run the tests in one file, one class, and just one test,
126
139
respectively. The pytest ``-k `` option selects tests based on a word in their
127
140
name, which can be very convenient for ad-hoc test selection. Of course you
128
141
can combine tox and pytest options::
129
142
130
- $ tox -q -e py37 -- -n 0 -vv -k hash
143
+ $ python3 -m tox -q -e py37 -- -n 0 -vv -k hash
131
144
=== CPython 3.7.15 with C tracer (.tox/py37/bin/python) ===
132
145
======================================= test session starts ========================================
133
146
platform darwin -- Python 3.7.15, pytest-7.2.2, pluggy-1.0.0 -- /Users/nedbat/coverage/.tox/py37/bin/python
0 commit comments