diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-27 11:51:41 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-27 11:51:41 -0500 |
| commit | 9f8efb28f903f3abe4764c485356c83e41adfa66 (patch) | |
| tree | c2f9e9a20ab4522f5b40f3d0bcef4673308fd257 /tests | |
| parent | 63f5e94eed42d446889bb7cebd69072df315f935 (diff) | |
| download | cherrypy-git-9f8efb28f903f3abe4764c485356c83e41adfa66.tar.gz | |
Add docstrings for clarity and to address pre-commit checks. Exclude dist-check from pre-commit name check.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dist-check.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/dist-check.py b/tests/dist-check.py index c8005faa..e6cdbcdd 100644 --- a/tests/dist-check.py +++ b/tests/dist-check.py @@ -1,3 +1,17 @@ +""" +Integration test to check the integrity of the +distribution. + +This file is explicitly not named 'test_' to avoid +being collected by pytest, but must instead be +invoked explicitly (i.e. pytest tests/dist-check.py). + +This test cannot be invoked as part of the normal +test suite nor can it be included in the normal test +suite because it must import cherrypy late (after +removing sys.path[0]). +""" + import os import sys @@ -11,6 +25,7 @@ import pytest 'tutorial/custom_error.html', ]) def data_file_path(request): + "generates data file paths expected to be found in the package" return request.param @@ -23,6 +38,10 @@ def remove_sys_path_0(): def test_data_files_installed(data_file_path): + """ + Ensure that data file paths are available in the + installed package as expected. + """ import cherrypy root = os.path.dirname(cherrypy.__file__) fn = os.path.join(root, data_file_path) @@ -32,5 +51,9 @@ def test_data_files_installed(data_file_path): def test_sanity(): + """ + Test the test to show that it does fail when a file + is missing. + """ with pytest.raises(Exception): test_data_files_installed('does not exist') |
