From 6a6347db219271299768a09da5fbaa8f55e3c5a3 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Wed, 27 May 2020 20:22:19 +0300 Subject: [PATCH] Fix linting in tests --- .gitattributes | 3 +++ .../{{cookiecutter.filename}}.py | 1 + tests/test_generate_files.py | 7 +++---- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..7ec0ef61a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto +*crlf.txt text eol=crlf +simple-with-newline.txt text eol=lf diff --git a/tests/test-generate-files-line-end/{{cookiecutter.test_name}}/{{cookiecutter.folder_name}}/{{cookiecutter.filename}}.py b/tests/test-generate-files-line-end/{{cookiecutter.test_name}}/{{cookiecutter.folder_name}}/{{cookiecutter.filename}}.py index 3cd27cd28..0e2debfcf 100644 --- a/tests/test-generate-files-line-end/{{cookiecutter.test_name}}/{{cookiecutter.folder_name}}/{{cookiecutter.filename}}.py +++ b/tests/test-generate-files-line-end/{{cookiecutter.test_name}}/{{cookiecutter.folder_name}}/{{cookiecutter.filename}}.py @@ -1 +1,2 @@ +"""Sample file to be created through a cookiecutter run.""" print("This is the contents of {{ cookiecutter.filename }}.py.") diff --git a/tests/test_generate_files.py b/tests/test_generate_files.py index 83befd439..4e930c0ea 100644 --- a/tests/test_generate_files.py +++ b/tests/test_generate_files.py @@ -91,11 +91,10 @@ def test_generate_files_with_trailing_newline(): @pytest.mark.usefixtures('clean_system', 'remove_additional_folders') def test_generate_files_with_windows_newline(): + """Verify windows source line end not changed during files generation.""" generate.generate_files( - context={ - 'cookiecutter': {'food': 'pizzä'} - }, - repo_dir='tests/test-generate-files' + context={'cookiecutter': {'food': 'pizzä'}}, + repo_dir='tests/test-generate-files', ) newline_file = 'inputpizzä/simple-with-newline-crlf.txt'