11from __future__ import annotations
22
33import datetime
4- import importlib
54import os
65import shlex
76import subprocess
87import sys
98from contextlib import contextmanager
109
11- import pytest
12- import yaml
13- from click .testing import CliRunner
1410from cookiecutter .utils import rmtree
1511
1612
@@ -94,9 +90,7 @@ def test_bake_and_run_tests(cookies):
9490
9591def test_bake_withspecialchars_and_run_tests (cookies ):
9692 """Ensure that a `full_name` with double quotes does not break setup.py"""
97- with bake_in_temp_dir (
98- cookies , extra_context = {"full_name" : 'name "quote" name' }
99- ) as result :
93+ with bake_in_temp_dir (cookies , extra_context = {"full_name" : 'name "quote" name' }) as result :
10094 assert result .project .isdir ()
10195 run_inside_dir ("python setup.py test" , str (result .project )) == 0
10296
@@ -119,24 +113,19 @@ def test_make_help(cookies):
119113def test_bake_selecting_license (cookies ):
120114 license_strings = {
121115 "MIT license" : "MIT " ,
122- "BSD license" : "Redistributions of source code must retain the "
123- + "above copyright notice, this" ,
116+ "BSD license" : "Redistributions of source code must retain the " + "above copyright notice, this" ,
124117 "ISC license" : "ISC License" ,
125118 "Apache Software License 2.0" : "Licensed under the Apache License, Version 2.0" ,
126119 "GNU General Public License v3" : "GNU GENERAL PUBLIC LICENSE" ,
127120 }
128121 for license , target_string in license_strings .items ():
129- with bake_in_temp_dir (
130- cookies , extra_context = {"open_source_license" : license }
131- ) as result :
122+ with bake_in_temp_dir (cookies , extra_context = {"open_source_license" : license }) as result :
132123 assert target_string in result .project .join ("LICENSE" ).read ()
133124 assert license in result .project .join ("setup.py" ).read ()
134125
135126
136127def test_bake_not_open_source (cookies ):
137- with bake_in_temp_dir (
138- cookies , extra_context = {"open_source_license" : "Not open source" }
139- ) as result :
128+ with bake_in_temp_dir (cookies , extra_context = {"open_source_license" : "Not open source" }) as result :
140129 found_toplevel_files = [f .basename for f in result .project .listdir ()]
141130 assert "setup.py" in found_toplevel_files
142131 assert "LICENSE" not in found_toplevel_files
0 commit comments