@@ -104,132 +104,19 @@ The `tests` directory has the following subdirectory structure:
104104 tests
105105 +-- unittest Unit tests
106106
107- There are multiple types of tests:
107+ * Unit tests
108108
109- 1. Unit tests
109+ These tests can be run standalone, and the tests validate their results
110+ automatically.
110111
111- These tests can be run standalone, and the tests validate their results
112- automatically.
112+ They are run by executing:
113113
114- They are run by executing:
114+ .. code-block :: bash
115115
116- .. code-block :: bash
117-
118- $ make test
119-
120- Test execution can be modified by a number of environment variables, as
121- documented in the make help (execute `make help `).
122-
123- An alternative that does not depend on the makefile and thus can be executed
124- from the source distribution archive, is:
125-
126- .. code-block :: bash
127-
128- $ ./setup.py test
129-
130- Options for pytest can be passed using the ``--pytest-options `` option.
131-
132-
133- To run the unit tests in all supported Python environments, the
134- Tox tool can be used. It creates the necessary virtual Python environments and
135- executes `make test ` (i.e. the unit tests) in each of them.
136-
137- For running Tox, it does not matter which Python environment is currently
138- active, as long as the Python `tox ` package is installed in it:
139-
140- .. code-block :: bash
141-
142- $ tox # Run tests on all supported Python versions
143- $ tox -e py27 # Run tests on Python 2.7
144-
145-
146- .. _`Testing from the source archives on Pypi or GitHub` :
147-
148- Testing from the source archives on Pypi or GitHub
149- --------------------------------------------------
150-
151- The wheel distribution archives on Pypi (e.g. ``*.whl ``) contain only the
152- files needed to run this package, but not the files needed to test it.
153-
154- The source distribution archives on Pypi and GitHub (e.g. ``*.tar.gz ``)
155- contain all files that are needed to run and to test this package. This allows
156- testing the package without having to check out the entire repository, and is
157- convenient for testing e.g. when packaging into OS-level packages.
158- Nevertheless, the test files are not installed when installing these source
159- distribution archives.
160-
161- The following commands download the source distribution archive on Pypi for a
162- particular version of the package into the current directory and unpack it:
163-
164- .. code-block :: bash
165-
166- $ pip download --no-deps --no-binary :all: immutable-views==1.0.0
167- $ tar -xf immutable-views-1.0.0.tar.gz
168- $ cd immutable-views-1.0.0
169- $ ls -1
170- -rw-r--r-- 1 johndoe staff 468 Jun 29 22:31 INSTALL.md
171- -rw-r--r-- 1 johndoe staff 26436 May 26 06:45 LICENSE.txt
172- -rw-r--r-- 1 johndoe staff 367 Jul 3 07:54 MANIFEST.in
173- -rw-r--r-- 1 johndoe staff 3451 Jul 3 07:55 PKG-INFO
174- -rw-r--r-- 1 johndoe staff 7665 Jul 2 23:20 README.rst
175- drwxr-xr-x 29 johndoe staff 928 Jul 3 07:55 immutable-views
176- drwxr-xr-x 8 johndoe staff 256 Jul 3 07:55 immutable-views.egg-info
177- -rw-r--r-- 1 johndoe staff 1067 Jun 29 22:31 requirements.txt
178- -rw-r--r-- 1 johndoe staff 38 Jul 3 07:55 setup.cfg
179- -rwxr-xr-x 1 johndoe staff 7555 Jul 3 07:24 setup.py
180- -rw-r--r-- 1 johndoe staff 2337 Jul 2 23:20 test-requirements.txt
181- drwxr-xr-x 15 johndoe staff 480 Jul 3 07:55 tests
182-
183- This package, its dependent packages for running it, and its dependent packages
184- for testing it can be installed with the package extra named "test":
185-
186- .. code-block :: bash
187-
188- $ pip install .[test]
189-
190- When testing in Linux distributions that include this package as an OS-level
191- package, the corresponding OS-level packages would instead be installed for
192- these dependent Python packages. The ``test-requirements.txt `` file shows which
193- dependent Python packages are needed for testing this package.
194-
195- Finally, the tests can be run using the ``setup.py `` script:
196-
197- .. code-block :: bash
198-
199- $ ./setup.py test
200-
201- These commands are listed in the help of the ``setup.py `` script:
202-
203- .. code-block :: bash
204-
205- $ ./setup.py --help-commands
206-
207- . . .
208-
209- Extra commands:
210- . . .
211- test Run unit tests using pytest
212- . . .
213-
214- The additional options supported by these commands are shown in their help:
215-
216- .. code-block :: bash
217-
218- $ ./setup.py test --help
219-
220- . . .
221-
222- Options for ' test' command:
223- --pytest-options additional options for pytest, as one argument
224-
225- . . .
116+ $ make test
226117
227- Note: The ``test `` command of ``setup.py `` is not the deprecated built-in
228- command (see `<https://github.com/pypa/setuptools/issues/1684 >`_), but has been
229- implemented in ``setup.py `` in such a way that it only runs the tests but
230- does not install anything upfront.
231- Therefore, this approach can be used for testing in Linux distributions that
232- include this package as an OS-level package.
118+ Test execution can be modified by a number of environment variables, as
119+ documented in the make help (execute `make help `).
233120
234121
235122.. _`Contributing` :
@@ -364,7 +251,7 @@ Git repo.
364251
365252 .. code-block :: sh
366253
367- vi immutable-views /_version.py
254+ vi immutable_views /_version.py
368255
369256 and set the ``__version__ `` variable to the version that is being released:
370257
@@ -552,7 +439,7 @@ Git repo.
552439
553440 .. code-block :: sh
554441
555- vi immutable-views /_version.py
442+ vi immutable_views /_version.py
556443
557444 and update the version to a draft version of the version that is being
558445 started:
@@ -572,7 +459,7 @@ Git repo.
572459 .. code-block :: rst
573460
574461 immutable-views M.N.U.dev1
575- ---------------------
462+ --------------------------
576463
577464 Released: not yet
578465
0 commit comments