Repository: cookiecutter/cookiecutter

Issue:
PEP257 docstrings for file "./docs/conf.py"
Cover `./docs/conf.py` file with docstrings and follow [PEP257](https://www.python.org/dev/peps/pep-0257/). We use [pydocstyle](https://pypi.org/project/pydocstyle/) for validation.

Current validation log:

```
./docs/conf.py:1 at module level:
        D100: Missing docstring in public module
./docs/conf.py:28 in public class `Mock`:
        D101: Missing docstring in public class
./docs/conf.py:29 in public method `__init__`:
        D107: Missing docstring in __init__
./docs/conf.py:32 in public method `__call__`:
        D102: Missing docstring in public method
./docs/conf.py:36 in public method `__getattr__`:
        D105: Missing docstring in magic method
```

Subtask for #742 


Discussion:

Resolving patch:
diff --git a/cookiecutter/extensions.py b/cookiecutter/extensions.py
--- a/cookiecutter/extensions.py
+++ b/cookiecutter/extensions.py
@@ -30,7 +30,7 @@ class RandomStringExtension(Extension):
     """Jinja2 extension to create a random string."""
 
     def __init__(self, environment):
-        """Jinja2 Extension Constructor"""
+        """Jinja2 Extension Constructor."""
         super(RandomStringExtension, self).__init__(environment)
 
         def random_ascii_string(length, punctuation=False):
diff --git a/docs/ccext.py b/docs/ccext.py
--- a/docs/ccext.py
+++ b/docs/ccext.py
@@ -11,7 +11,10 @@
 
 
 class CcCommandLineOptions(rst.Directive):
+    """Custom docutils extension class to parse cli commands from code."""
+
     def _format_option(self, option):
+        """Do cli options formatting."""
         return [
             ".. _`%s`:" % option.name,
             "",
@@ -22,12 +25,14 @@ def _format_option(self, option):
         ]
 
     def process_actions(self):
+        """Get options from cookiecutter, send to formatter, prepare result."""
         for option in cli.main.params:
             if isinstance(option, click.core.Option):
                 for line in self._format_option(option):
                     self.view_list.append(line, "")
 
     def run(self):
+        """Override `run` in `rst.Directive` class."""
         node = nodes.paragraph()
         node.document = self.state.document
         self.view_list = ViewList()
@@ -37,4 +42,5 @@ def run(self):
 
 
 def setup(app):
+    """Register a Docutils extension directive."""
     app.add_directive('cc-command-line-options', CcCommandLineOptions)
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-"""cookiecutter distutils configuration"""
+"""cookiecutter distutils configuration."""
 
 import os
 import io


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1 +1 @@
-"""Cookiecutter integration tests"""
+"""Cookiecutter integration tests."""
diff --git a/tests/replay/test_dump.py b/tests/replay/test_dump.py
--- a/tests/replay/test_dump.py
+++ b/tests/replay/test_dump.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_dump"""
+"""test_dump."""
 
 import json
 import os
@@ -52,6 +52,11 @@ def test_value_error_if_key_missing_in_context(replay_test_dir, template_name):
 
 @pytest.fixture
 def mock_ensure_failure(mocker):
+    """Replace cookiecutter.replay.make_sure_path_exists function.
+
+    Used to mock internal function and limit test scope.
+    Always return expected value: False
+    """
     return mocker.patch(
         'cookiecutter.replay.make_sure_path_exists',
         return_value=False
@@ -60,6 +65,11 @@ def mock_ensure_failure(mocker):
 
 @pytest.fixture
 def mock_ensure_success(mocker):
+    """Replace cookiecutter.replay.make_sure_path_exists function.
+
+    Used to mock internal function and limit test scope.
+    Always return expected value: True
+    """
     return mocker.patch(
         'cookiecutter.replay.make_sure_path_exists',
         return_value=True
diff --git a/tests/replay/test_load.py b/tests/replay/test_load.py
--- a/tests/replay/test_load.py
+++ b/tests/replay/test_load.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_load"""
+"""test_load."""
 
 import json
 import os
diff --git a/tests/replay/test_replay.py b/tests/replay/test_replay.py
--- a/tests/replay/test_replay.py
+++ b/tests/replay/test_replay.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_replay"""
+"""test_replay."""
 
 import os
 import pytest
@@ -14,21 +14,19 @@ def test_get_replay_file_name():
     assert replay.get_file_name('foo', 'bar') == exp_replay_file_name
 
 
-@pytest.fixture(params=[
-    {'no_input': True},
-    {'extra_context': {}},
-    {'no_input': True, 'extra_context': {}},
-])
-def invalid_kwargs(request):
-    return request.param
-
-
+@pytest.mark.parametrize(
+    'invalid_kwargs', ({'no_input': True},
+                       {'extra_context': {}},
+                       {'no_input': True, 'extra_context': {}},)
+)
 def test_raise_on_invalid_mode(invalid_kwargs):
+    """Test `cookiecutter` raise exception on unacceptable `replay` request."""
     with pytest.raises(exceptions.InvalidModeException):
         main.cookiecutter('foo', replay=True, **invalid_kwargs)
 
 
 def test_main_does_not_invoke_dump_but_load(mocker):
+    """Test `cookiecutter` calling correct functions on `replay`."""
     mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
     mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
     mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
@@ -45,6 +43,7 @@ def test_main_does_not_invoke_dump_but_load(mocker):
 
 
 def test_main_does_not_invoke_load_but_dump(mocker):
+    """Test `cookiecutter` calling correct functions on non-replay launch."""
     mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
     mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
     mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
diff --git a/tests/test-extensions/hello_extension/__init__.py b/tests/test-extensions/hello_extension/__init__.py
--- a/tests/test-extensions/hello_extension/__init__.py
+++ b/tests/test-extensions/hello_extension/__init__.py
@@ -1,2 +1,2 @@
 # -*- coding: utf-8 -*-
-"""Hello Extension"""
+"""Hello Extension."""
diff --git a/tests/test-extensions/hello_extension/hello_extension.py b/tests/test-extensions/hello_extension/hello_extension.py
--- a/tests/test-extensions/hello_extension/hello_extension.py
+++ b/tests/test-extensions/hello_extension/hello_extension.py
@@ -7,10 +7,12 @@
 
 
 class HelloExtension(Extension):
+    """Simple jinja2 extension for cookiecutter test purposes."""
+
     tags = set(['hello'])
 
     def __init__(self, environment):
-        """Hello Extension Constructor"""
+        """Hello Extension Constructor."""
         super(HelloExtension, self).__init__(environment)
 
     def _hello(self, name):
diff --git a/tests/test_abort_generate_on_hook_error.py b/tests/test_abort_generate_on_hook_error.py
--- a/tests/test_abort_generate_on_hook_error.py
+++ b/tests/test_abort_generate_on_hook_error.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_abort_generate_on_hook_error
+test_abort_generate_on_hook_error.
 
 Tests to ensure cookiecutter properly exits with a non-zero exit code whenever
 errors occur in (optional) pre- or pos-gen hooks.
diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -42,10 +42,12 @@ def make_fake_project_dir(request):
 
 @pytest.fixture(params=['-V', '--version'])
 def version_cli_flag(request):
+    """Pytest fixture return both version invocation options."""
     return request.param
 
 
 def test_cli_version(cli_runner, version_cli_flag):
+    """Verify correct version output by `cookiecutter` on cli invocation."""
     result = cli_runner(version_cli_flag)
     assert result.exit_code == 0
     assert result.output.startswith('Cookiecutter')
@@ -53,6 +55,7 @@ def test_cli_version(cli_runner, version_cli_flag):
 
 @pytest.mark.usefixtures('make_fake_project_dir', 'remove_fake_project_dir')
 def test_cli_error_on_existing_output_directory(cli_runner):
+    """Test cli invocation without `overwrite-if-exists` fail if dir exist."""
     result = cli_runner('tests/fake-repo-pre/', '--no-input')
     assert result.exit_code != 0
     expected_error_msg = 'Error: "fake-project" directory already exists\n'
@@ -61,6 +64,7 @@ def test_cli_error_on_existing_output_directory(cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli(cli_runner):
+    """Test cli invocation work without flags if directory not exist."""
     result = cli_runner('tests/fake-repo-pre/', '--no-input')
     assert result.exit_code == 0
     assert os.path.isdir('fake-project')
@@ -70,6 +74,7 @@ def test_cli(cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_verbose(cli_runner):
+    """Test cli invocation display log if called with `verbose` flag."""
     result = cli_runner('tests/fake-repo-pre/', '--no-input', '-v')
     assert result.exit_code == 0
     assert os.path.isdir('fake-project')
@@ -79,6 +84,7 @@ def test_cli_verbose(cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_replay(mocker, cli_runner):
+    """Test cli invocation display log with `verbose` and `replay` flags."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter'
     )
@@ -104,6 +110,7 @@ def test_cli_replay(mocker, cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_exit_on_noinput_and_replay(mocker, cli_runner):
+    """Test cli invocation fail if both `no-input` and `replay` flags passed."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter',
         side_effect=cookiecutter
@@ -138,12 +145,14 @@ def test_cli_exit_on_noinput_and_replay(mocker, cli_runner):
 
 @pytest.fixture(params=['-f', '--overwrite-if-exists'])
 def overwrite_cli_flag(request):
+    """Pytest fixture return all `overwrite-if-exists` invocation options."""
     return request.param
 
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_run_cookiecutter_on_overwrite_if_exists_and_replay(
         mocker, cli_runner, overwrite_cli_flag):
+    """Test cli invocation with `overwrite-if-exists` and `replay` flags."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter',
         side_effect=cookiecutter
@@ -172,7 +181,10 @@ def test_run_cookiecutter_on_overwrite_if_exists_and_replay(
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_overwrite_if_exists_when_output_dir_does_not_exist(
         cli_runner, overwrite_cli_flag):
+    """Test cli invocation with `overwrite-if-exists` and `no-input` flags.
 
+    Case when output dir not exist.
+    """
     result = cli_runner(
         'tests/fake-repo-pre/',
         '--no-input',
@@ -186,7 +198,10 @@ def test_cli_overwrite_if_exists_when_output_dir_does_not_exist(
 @pytest.mark.usefixtures('make_fake_project_dir', 'remove_fake_project_dir')
 def test_cli_overwrite_if_exists_when_output_dir_exists(
         cli_runner, overwrite_cli_flag):
+    """Test cli invocation with `overwrite-if-exists` and `no-input` flags.
 
+    Case when output dir already exist.
+    """
     result = cli_runner(
         'tests/fake-repo-pre/',
         '--no-input',
@@ -198,15 +213,18 @@ def test_cli_overwrite_if_exists_when_output_dir_exists(
 
 @pytest.fixture(params=['-o', '--output-dir'])
 def output_dir_flag(request):
+    """Pytest fixture return all output-dir invocation options."""
     return request.param
 
 
 @pytest.fixture
 def output_dir(tmpdir):
+    """Pytest fixture return `output_dir` argument as string."""
     return str(tmpdir.mkdir('output'))
 
 
 def test_cli_output_dir(mocker, cli_runner, output_dir_flag, output_dir):
+    """Test cli invocation with `output-dir` flag changes output directory."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter'
     )
@@ -232,10 +250,12 @@ def test_cli_output_dir(mocker, cli_runner, output_dir_flag, output_dir):
 
 @pytest.fixture(params=['-h', '--help', 'help'])
 def help_cli_flag(request):
+    """Pytest fixture return all help invocation options."""
     return request.param
 
 
 def test_cli_help(cli_runner, help_cli_flag):
+    """Test cli invocation display help message with `help` flag."""
     result = cli_runner(help_cli_flag)
     assert result.exit_code == 0
     assert result.output.startswith('Usage')
@@ -243,10 +263,12 @@ def test_cli_help(cli_runner, help_cli_flag):
 
 @pytest.fixture
 def user_config_path(tmpdir):
+    """Pytest fixture return `user_config` argument as string."""
     return str(tmpdir.join('tests/config.yaml'))
 
 
 def test_user_config(mocker, cli_runner, user_config_path):
+    """Test cli invocation works with `config-file` option."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter'
     )
@@ -271,6 +293,7 @@ def test_user_config(mocker, cli_runner, user_config_path):
 
 
 def test_default_user_config_overwrite(mocker, cli_runner, user_config_path):
+    """Test cli invocation ignores `config-file` if `default-config` passed."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter'
     )
@@ -300,6 +323,7 @@ def test_default_user_config_overwrite(mocker, cli_runner, user_config_path):
 
 
 def test_default_user_config(mocker, cli_runner):
+    """Test cli invocation accepts `default-config` flag correctly."""
     mock_cookiecutter = mocker.patch(
         'cookiecutter.cli.cookiecutter'
     )
@@ -324,6 +348,7 @@ def test_default_user_config(mocker, cli_runner):
 
 
 def test_echo_undefined_variable_error(tmpdir, cli_runner):
+    """Cli invocation return error if variable undefined in template."""
     output_dir = str(tmpdir.mkdir('output'))
     template_path = 'tests/undefined-variable/file-name/'
 
@@ -357,6 +382,7 @@ def test_echo_undefined_variable_error(tmpdir, cli_runner):
 
 
 def test_echo_unknown_extension_error(tmpdir, cli_runner):
+    """Cli return error if extension incorrectly defined in template."""
     output_dir = str(tmpdir.mkdir('output'))
     template_path = 'tests/test-extensions/unknown/'
 
@@ -375,6 +401,7 @@ def test_echo_unknown_extension_error(tmpdir, cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_extra_context(cli_runner):
+    """Cli invocation replace content if called with replacement pairs."""
     result = cli_runner(
         'tests/fake-repo-pre/',
         '--no-input',
@@ -389,6 +416,7 @@ def test_cli_extra_context(cli_runner):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_cli_extra_context_invalid_format(cli_runner):
+    """Cli invocation raise error if called with unknown argument."""
     result = cli_runner(
         'tests/fake-repo-pre/',
         '--no-input',
@@ -402,11 +430,16 @@ def test_cli_extra_context_invalid_format(cli_runner):
 
 @pytest.fixture
 def debug_file(tmpdir):
-    return tmpdir / 'fake-repo.log'
+    """Pytest fixture return `debug_file` argument as path object."""
+    return tmpdir.join('fake-repo.log')
 
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_debug_file_non_verbose(cli_runner, debug_file):
+    """Test cli invocation writes log to `debug-file` if flag enabled.
+
+    Case for normal log output.
+    """
     assert not debug_file.exists()
 
     result = cli_runner(
@@ -429,6 +462,10 @@ def test_debug_file_non_verbose(cli_runner, debug_file):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_debug_file_verbose(cli_runner, debug_file):
+    """Test cli invocation writes log to `debug-file` if flag enabled.
+
+    Case for verbose log output.
+    """
     assert not debug_file.exists()
 
     result = cli_runner(
@@ -452,6 +489,7 @@ def test_debug_file_verbose(cli_runner, debug_file):
 
 @pytest.mark.usefixtures('remove_fake_project_dir')
 def test_directory_repo(cli_runner):
+    """Test cli invocation works with `directory` option."""
     result = cli_runner(
         'tests/fake-repo-dir/',
         '--no-input',
diff --git a/tests/test_cookiecutter_invocation.py b/tests/test_cookiecutter_invocation.py
--- a/tests/test_cookiecutter_invocation.py
+++ b/tests/test_cookiecutter_invocation.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_cookiecutter_invocation
+test_cookiecutter_invocation.
 
 Tests to make sure that cookiecutter can be called from the cli without
 using the entry point set up for the package.
diff --git a/tests/test_cookiecutter_local_no_input.py b/tests/test_cookiecutter_local_no_input.py
--- a/tests/test_cookiecutter_local_no_input.py
+++ b/tests/test_cookiecutter_local_no_input.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_cookiecutter_local_no_input
+test_cookiecutter_local_no_input.
 
 Tests formerly known from a unittest residing in test_main.py named
 TestCookiecutterLocalNoInput.test_cookiecutter
@@ -51,7 +51,7 @@ def test_cookiecutter():
 
 @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
 def test_cookiecutter_no_input_extra_context():
-    """Call `cookiecutter()` with `no_input=True` and `extra_context"""
+    """Call `cookiecutter()` with `no_input=True` and `extra_context."""
     main.cookiecutter(
         'tests/fake-repo-pre',
         no_input=True,
@@ -63,7 +63,7 @@ def test_cookiecutter_no_input_extra_context():
 @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
 def test_cookiecutter_templated_context():
     """Call `cookiecutter()` with `no_input=True` and templates in the \
-    cookiecutter.json file"""
+    cookiecutter.json file."""
     main.cookiecutter(
         'tests/fake-repo-tmpl',
         no_input=True
@@ -127,7 +127,7 @@ def test_cookiecutter_dict_values_in_context():
 @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
 def test_cookiecutter_template_cleanup(mocker):
     """Call `cookiecutter()` with `no_input=True` and templates in the \
-    cookiecutter.json file"""
+    cookiecutter.json file."""
     mocker.patch(
         'tempfile.mkdtemp',
         return_value='fake-tmp',
diff --git a/tests/test_cookiecutter_local_with_input.py b/tests/test_cookiecutter_local_with_input.py
--- a/tests/test_cookiecutter_local_with_input.py
+++ b/tests/test_cookiecutter_local_with_input.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_cookiecutter_local_with_input
+test_cookiecutter_local_with_input.
 
 Tests formerly known from a unittest residing in test_main.py named
 TestCookiecutterLocalWithInput.test_cookiecutter_local_with_input
@@ -42,7 +42,7 @@ def test_cookiecutter_local_with_input(monkeypatch):
 
 @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
 def test_cookiecutter_input_extra_context(monkeypatch):
-    """Call `cookiecutter()` with `no_input=False` and `extra_context`"""
+    """Call `cookiecutter()` with `no_input=False` and `extra_context`."""
     monkeypatch.setattr(
         'cookiecutter.prompt.read_user_variable',
         lambda var, default: default
diff --git a/tests/test_custom_extensions_in_hooks.py b/tests/test_custom_extensions_in_hooks.py
--- a/tests/test_custom_extensions_in_hooks.py
+++ b/tests/test_custom_extensions_in_hooks.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_custom_extension_in_hooks
+test_custom_extension_in_hooks.
 
 Tests to ensure custom cookiecutter extensions are properly made available to
 pre- and post-gen hooks.
diff --git a/tests/test_default_extensions.py b/tests/test_default_extensions.py
--- a/tests/test_default_extensions.py
+++ b/tests/test_default_extensions.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_default_extensions
+test_default_extensions.
 
 Tests to ensure Jinja2 filters/extensions are available from within pre- and
 post-gen hooks.
diff --git a/tests/test_find.py b/tests/test_find.py
--- a/tests/test_find.py
+++ b/tests/test_find.py
@@ -11,10 +11,12 @@
 
 @pytest.fixture(params=['fake-repo-pre', 'fake-repo-pre2'])
 def repo_dir(request):
+    """Fixture returning path for `test_find_template` test."""
     return os.path.join('tests', request.param)
 
 
 def test_find_template(repo_dir):
+    """Verify correctness of `find.find_template` path detection."""
     template = find.find_template(repo_dir=repo_dir)
 
     test_dir = os.path.join(repo_dir, '{{cookiecutter.repo_name}}')
diff --git a/tests/test_generate_context.py b/tests/test_generate_context.py
--- a/tests/test_generate_context.py
+++ b/tests/test_generate_context.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_generate_context
+test_generate_context.
 
 Tests formerly known from a unittest residing in test_generate.py named
 TestGenerateContext.test_generate_context
diff --git a/tests/test_generate_copy_without_render.py b/tests/test_generate_copy_without_render.py
--- a/tests/test_generate_copy_without_render.py
+++ b/tests/test_generate_copy_without_render.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_generate_copy_without_render"""
+"""test_generate_copy_without_render."""
 
 from __future__ import unicode_literals
 import os
diff --git a/tests/test_generate_file.py b/tests/test_generate_file.py
--- a/tests/test_generate_file.py
+++ b/tests/test_generate_file.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_generate_file
+test_generate_file.
 
 Tests formerly known from a unittest residing in test_generate.py named
 TestGenerateFile.test_generate_file
diff --git a/tests/test_generate_files.py b/tests/test_generate_files.py
--- a/tests/test_generate_files.py
+++ b/tests/test_generate_files.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_generate_files
+test_generate_files.
 
 Tests formerly known from a unittest residing in test_generate.py named
 TestGenerateFiles.test_generate_files_nontemplated_exception
@@ -165,7 +165,7 @@ def test_return_rendered_project_dir():
 @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
 def test_generate_files_permissions():
     """simple.txt and script.sh should retain their respective 0o644 and \
-    0o755 permissions"""
+    0o755 permissions."""
     generate.generate_files(
         context={
             'cookiecutter': {'permissions': 'permissions'}
diff --git a/tests/test_generate_hooks.py b/tests/test_generate_hooks.py
--- a/tests/test_generate_hooks.py
+++ b/tests/test_generate_hooks.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_generate_hooks
+test_generate_hooks.
 
 Tests formerly known from a unittest residing in test_generate.py named
 TestHooks.test_ignore_hooks_dirs
diff --git a/tests/test_get_config.py b/tests/test_get_config.py
--- a/tests/test_get_config.py
+++ b/tests/test_get_config.py
@@ -54,7 +54,7 @@ def test_merge_configs():
 
 
 def test_get_config():
-    """Opening and reading config file"""
+    """Opening and reading config file."""
     conf = config.get_config('tests/test-config/valid-config.yaml')
     expected_conf = {
         'cookiecutters_dir': '/home/example/some-path-to-templates',
@@ -96,7 +96,7 @@ def test_invalid_config():
 
 
 def test_get_config_with_defaults():
-    """A config file that overrides 1 of 3 defaults"""
+    """A config file that overrides 1 of 3 defaults."""
     conf = config.get_config('tests/test-config/valid-partial-config.yaml')
     default_cookiecutters_dir = os.path.expanduser('~/.cookiecutters/')
     default_replay_dir = os.path.expanduser('~/.cookiecutter_replay/')
diff --git a/tests/test_get_user_config.py b/tests/test_get_user_config.py
--- a/tests/test_get_user_config.py
+++ b/tests/test_get_user_config.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-test_get_user_config
+test_get_user_config.
 
 Tests formerly known from a unittest residing in test_config.py named
 TestGetUserConfig.test_get_user_config_valid
@@ -41,7 +41,7 @@ def remove_test_rc():
             os.remove(user_config_path)
 
     def restore_original_rc():
-        """If it existed, restore the original ~/.cookiecutterrc"""
+        """If it existed, restore the original ~/.cookiecutterrc."""
         if os.path.exists(user_config_path_backup):
             shutil.copy(user_config_path_backup, user_config_path)
             os.remove(user_config_path_backup)
@@ -74,7 +74,7 @@ def custom_config():
 
 @pytest.mark.usefixtures('back_up_rc')
 def test_get_user_config_valid(user_config_path, custom_config):
-    """Get config from a valid ~/.cookiecutterrc file"""
+    """Get config from a valid ~/.cookiecutterrc file."""
     shutil.copy('tests/test-config/valid-config.yaml', user_config_path)
     conf = config.get_user_config()
 
@@ -83,7 +83,7 @@ def test_get_user_config_valid(user_config_path, custom_config):
 
 @pytest.mark.usefixtures('back_up_rc')
 def test_get_user_config_invalid(user_config_path):
-    """Get config from an invalid ~/.cookiecutterrc file"""
+    """Get config from an invalid ~/.cookiecutterrc file."""
     shutil.copy('tests/test-config/invalid-config.yaml', user_config_path)
     with pytest.raises(InvalidConfiguration):
         config.get_user_config()
@@ -91,7 +91,7 @@ def test_get_user_config_invalid(user_config_path):
 
 @pytest.mark.usefixtures('back_up_rc')
 def test_get_user_config_nonexistent():
-    """Get config from a nonexistent ~/.cookiecutterrc file"""
+    """Get config from a nonexistent ~/.cookiecutterrc file."""
     assert config.get_user_config() == config.DEFAULT_CONFIG
 
 
diff --git a/tests/test_hooks.py b/tests/test_hooks.py
--- a/tests/test_hooks.py
+++ b/tests/test_hooks.py
@@ -53,13 +53,16 @@ def make_test_repo(name):
 
 
 class TestFindHooks(object):
+    """Class to unite find hooks related tests in one place."""
 
     repo_path = 'tests/test-hooks'
 
     def setup_method(self, method):
+        """Find hooks related tests setup fixture."""
         self.post_hook = make_test_repo(self.repo_path)
 
     def teardown_method(self, method):
+        """Find hooks related tests teardown fixture."""
         utils.rmtree(self.repo_path)
 
     def test_find_hook(self):
@@ -74,11 +77,12 @@ def test_find_hook(self):
             assert expected_post == actual_hook_path
 
     def test_no_hooks(self):
-        """find_hooks should return None if the hook could not be found."""
+        """`find_hooks` should return None if the hook could not be found."""
         with utils.work_in('tests/fake-repo'):
             assert None is hooks.find_hook('pre_gen_project')
 
     def test_unknown_hooks_dir(self):
+        """`find_hooks` should return None if hook directory not found."""
         with utils.work_in(self.repo_path):
             assert hooks.find_hook(
                 'pre_gen_project',
@@ -86,19 +90,23 @@ def test_unknown_hooks_dir(self):
             ) is None
 
     def test_hook_not_found(self):
+        """`find_hooks` should return None if the hook could not be found."""
         with utils.work_in(self.repo_path):
             assert hooks.find_hook('unknown_hook') is None
 
 
 class TestExternalHooks(object):
+    """Class to unite tests for hooks with different project paths."""
 
     repo_path = os.path.abspath('tests/test-hooks/')
     hooks_path = os.path.abspath('tests/test-hooks/hooks')
 
     def setup_method(self, method):
+        """External hooks related tests setup fixture."""
         self.post_hook = make_test_repo(self.repo_path)
 
     def teardown_method(self, method):
+        """External hooks related tests teardown fixture."""
         utils.rmtree(self.repo_path)
 
         if os.path.exists('python_pre.txt'):
@@ -115,12 +123,12 @@ def teardown_method(self, method):
             os.remove('tests/context_post.txt')
 
     def test_run_script(self):
-        """Execute a hook script, independently of project generation"""
+        """Execute a hook script, independently of project generation."""
         hooks.run_script(os.path.join(self.hooks_path, self.post_hook))
         assert os.path.isfile('shell_post.txt')
 
     def test_run_script_cwd(self):
-        """Change directory before running hook"""
+        """Change directory before running hook."""
         hooks.run_script(
             os.path.join(self.hooks_path, self.post_hook),
             'tests'
@@ -129,7 +137,7 @@ def test_run_script_cwd(self):
         assert 'tests' not in os.getcwd()
 
     def test_run_script_with_context(self):
-        """Execute a hook script, passing a context"""
+        """Execute a hook script, passing a context."""
         hook_path = os.path.join(self.hooks_path, 'post_gen_project.sh')
 
         if sys.platform.startswith('win'):
@@ -171,6 +179,7 @@ def test_run_hook(self):
             assert os.path.isfile(os.path.join(tests_dir, 'shell_post.txt'))
 
     def test_run_failing_hook(self):
+        """Test correct exception raise if hook exit code is not zero."""
         hook_path = os.path.join(self.hooks_path, 'pre_gen_project.py')
         tests_dir = os.path.join(self.repo_path, 'input{{hooks}}')
 
@@ -184,7 +193,7 @@ def test_run_failing_hook(self):
             assert 'Hook script failed' in str(excinfo.value)
 
 
-@pytest.yield_fixture
+@pytest.fixture()
 def dir_with_hooks(tmpdir):
     """Yield a directory that contains hook backup files."""
     hooks_dir = tmpdir.mkdir('hooks')
@@ -219,6 +228,7 @@ def dir_with_hooks(tmpdir):
 
 
 def test_ignore_hook_backup_files(monkeypatch, dir_with_hooks):
+    """Test `find_hook` correctly use `valid_hook` verification function."""
     # Change the current working directory that contains `hooks/`
     monkeypatch.chdir(dir_with_hooks)
     assert hooks.find_hook('pre_gen_project') is None
diff --git a/tests/test_main.py b/tests/test_main.py
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -7,7 +7,7 @@
 
 def test_replay_dump_template_name(
         monkeypatch, mocker, user_config_data, user_config_file):
-    """Check that replay_dump is called with a valid template_name
+    """Check that replay_dump is called with a valid template_name.
 
     Template name must not be a relative path.
 
@@ -39,7 +39,7 @@ def test_replay_dump_template_name(
 
 def test_replay_load_template_name(
         monkeypatch, mocker, user_config_data, user_config_file):
-    """Check that replay_load is called correctly
+    """Check that replay_load is called correctly.
 
     Calls require valid template_name that is not a relative path.
 
diff --git a/tests/test_output_folder.py b/tests/test_output_folder.py
--- a/tests/test_output_folder.py
+++ b/tests/test_output_folder.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 """
-tests_output_folder
+tests_output_folder.
 
 Test formerly known from a unittest residing in test_generate.py named
 TestOutputFolder.test_output_folder
diff --git a/tests/test_prompt.py b/tests/test_prompt.py
--- a/tests/test_prompt.py
+++ b/tests/test_prompt.py
@@ -45,6 +45,8 @@ def patch_readline_on_win(monkeypatch):
 
 
 class TestPrompt(object):
+    """Class to unite user prompt related tests."""
+
     def test_prompt_for_config_simple(self, monkeypatch):
         monkeypatch.setattr(
             'cookiecutter.prompt.read_user_variable',
@@ -260,6 +262,8 @@ def test_dont_prompt_for_private_context_var(self, monkeypatch):
 
 
 class TestReadUserChoice(object):
+    """Class to unite choices prompt related tests."""
+
     def test_should_invoke_read_user_choice(self, mocker):
         prompt_choice = mocker.patch(
             'cookiecutter.prompt.prompt_choice_for_config',
@@ -342,6 +346,8 @@ def test_should_render_choices(self, mocker):
 
 
 class TestPromptChoiceForConfig(object):
+    """Class to unite choices prompt related tests with config test."""
+
     @pytest.fixture
     def choices(self):
         return ['landscape', 'portrait', 'all']
diff --git a/tests/test_read_repo_password.py b/tests/test_read_repo_password.py
--- a/tests/test_read_repo_password.py
+++ b/tests/test_read_repo_password.py
@@ -6,6 +6,10 @@
 
 
 def test_click_invocation(mocker):
+    """Test click function called correctly by cookiecutter.
+
+    Test for password (hidden input) type invocation.
+    """
     prompt = mocker.patch('click.prompt')
     prompt.return_value = 'sekrit'
 
diff --git a/tests/test_read_user_choice.py b/tests/test_read_user_choice.py
--- a/tests/test_read_user_choice.py
+++ b/tests/test_read_user_choice.py
@@ -19,6 +19,10 @@
 
 @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTIONS, 1))
 def test_click_invocation(mocker, user_choice, expected_value):
+    """Test click function called correctly by cookiecutter.
+
+    Test for choice type invocation.
+    """
     choice = mocker.patch('click.Choice')
     choice.return_value = click.Choice(OPTIONS)
 
@@ -36,6 +40,10 @@ def test_click_invocation(mocker, user_choice, expected_value):
 
 
 def test_raise_if_options_is_not_a_non_empty_list():
+    """Test function called by cookiecutter raise expected errors.
+
+    Test for choice type invocation.
+    """
     with pytest.raises(TypeError):
         read_user_choice('foo', 'NOT A LIST')
 
diff --git a/tests/test_read_user_dict.py b/tests/test_read_user_dict.py
--- a/tests/test_read_user_dict.py
+++ b/tests/test_read_user_dict.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_read_user_dict"""
+"""Test `process_json`, `read_user_dict` functions in `cookiecutter.prompt`."""
 
 from __future__ import unicode_literals
 
@@ -14,6 +14,7 @@
 
 
 def test_process_json_invalid_json():
+    """Test `process_json` for correct error on malformed input."""
     with pytest.raises(click.UsageError) as exc_info:
         process_json('nope]')
 
@@ -21,6 +22,7 @@ def test_process_json_invalid_json():
 
 
 def test_process_json_non_dict():
+    """Test `process_json` for correct error on non-JSON input."""
     with pytest.raises(click.UsageError) as exc_info:
         process_json('[1, 2]')
 
@@ -28,6 +30,10 @@ def test_process_json_non_dict():
 
 
 def test_process_json_valid_json():
+    """Test `process_json` for correct output on JSON input.
+
+    Test for simple dict with list.
+    """
     user_value = '{"name": "foobar", "bla": ["a", 1, "b", false]}'
 
     assert process_json(user_value) == {
@@ -37,6 +43,10 @@ def test_process_json_valid_json():
 
 
 def test_process_json_deep_dict():
+    """Test `process_json` for correct output on JSON input.
+
+    Test for dict in dict case.
+    """
     user_value = '''{
         "key": "value",
         "integer_key": 37,
@@ -77,7 +87,8 @@ def test_process_json_deep_dict():
 
 
 def test_should_raise_type_error(mocker):
-    prompt = mocker.patch('click.prompt')
+    """Test `default_value` arg verification in `read_user_dict` function."""
+    prompt = mocker.patch('cookiecutter.prompt.click.prompt')
 
     with pytest.raises(TypeError):
         read_user_dict('name', 'russell')
@@ -86,7 +97,7 @@ def test_should_raise_type_error(mocker):
 
 
 def test_should_call_prompt_with_process_json(mocker):
-    """Test to make sure that process_jon is actually being used
+    """Test to make sure that `process_json` is actually being used.
 
     Verifies generation of a processor for the user input.
     """
@@ -106,7 +117,7 @@ def test_should_call_prompt_with_process_json(mocker):
 
 
 def test_read_user_dict_default_value(mocker):
-    """Make sure that read_user_dict returns the default value
+    """Make sure that `read_user_dict` returns the default value.
 
     Verify return of a dict variable rather than the display value.
     """
diff --git a/tests/test_read_user_variable.py b/tests/test_read_user_variable.py
--- a/tests/test_read_user_variable.py
+++ b/tests/test_read_user_variable.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_read_user_variable"""
+"""test_read_user_variable."""
 
 from __future__ import unicode_literals
 
@@ -13,6 +13,10 @@
 
 
 def test_click_invocation(mocker):
+    """Test click function called correctly by cookiecutter.
+
+    Test for string type invocation.
+    """
     prompt = mocker.patch('click.prompt')
     prompt.return_value = DEFAULT
 
diff --git a/tests/test_read_user_yes_no.py b/tests/test_read_user_yes_no.py
--- a/tests/test_read_user_yes_no.py
+++ b/tests/test_read_user_yes_no.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-"""test_read_user_yes_no"""
+"""test_read_user_yes_no."""
 
 from __future__ import unicode_literals
 
@@ -13,6 +13,10 @@
 
 
 def test_click_invocation(mocker):
+    """Test click function called correctly by cookiecutter.
+
+    Test for boolean type invocation.
+    """
     prompt = mocker.patch('click.prompt')
     prompt.return_value = DEFAULT
 
diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -140,7 +140,7 @@ def answer(question, default):
 
 
 def test_prompt_should_not_ask_if_no_input_and_rm_repo_dir(mocker, tmpdir):
-    """Prompt shoul dnot ask if no input and rm dir
+    """Prompt should not ask if no input and rm dir.
 
     In `prompt_and_delete()`, if `no_input` is True, the call to
     `prompt.read_user_yes_no()` should be suppressed.
@@ -160,7 +160,7 @@ def test_prompt_should_not_ask_if_no_input_and_rm_repo_dir(mocker, tmpdir):
 
 
 def test_prompt_should_not_ask_if_no_input_and_rm_repo_file(mocker, tmpdir):
-    """Prompt should not ask if no input and rm file
+    """Prompt should not ask if no input and rm file.
 
     In `prompt_and_delete()`, if `no_input` is True, the call to
     `prompt.read_user_yes_no()` should be suppressed.