Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 3 additions & 47 deletions tests/test_bake_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def test_bake_and_run_tests(cookies):
with bake_in_temp_dir(cookies) as result:
assert result.project.isdir()
run_inside_dir('python setup.py test', str(result.project)) == 0
print("test_bake_and_run_tests path", str(result.project))


def test_bake_withspecialchars_and_run_tests(cookies):
Expand All @@ -111,26 +110,6 @@ def test_bake_with_apostrophe_and_run_tests(cookies):
run_inside_dir('python setup.py test', str(result.project)) == 0


# def test_bake_and_run_travis_pypi_setup(cookies):
# # given:
# with bake_in_temp_dir(cookies) as result:
# project_path = str(result.project)
#
# # when:
# travis_setup_cmd = ('python travis_pypi_setup.py'
# ' --repo audreyr/cookiecutter-pypackage'
# ' --password invalidpass')
# run_inside_dir(travis_setup_cmd, project_path)
# # then:
# result_travis_config = yaml.load(
# result.project.join(".travis.yml").open()
# )
# min_size_of_encrypted_password = 50
# assert len(
# result_travis_config["deploy"]["password"]["secure"]
# ) > min_size_of_encrypted_password


def test_bake_without_travis_pypi_setup(cookies):
with bake_in_temp_dir(
cookies,
Expand Down Expand Up @@ -217,8 +196,7 @@ def test_using_pytest(cookies):
test_file_path = result.project.join(
'tests/test_python_boilerplate.py'
)
lines = test_file_path.readlines()
assert "import pytest" in ''.join(lines)
assert "import pytest" in test_file_path.read()
# Test the new pytest target
run_inside_dir('python setup.py pytest', str(result.project)) == 0
# Test the test alias (which invokes pytest)
Expand All @@ -231,30 +209,8 @@ def test_not_using_pytest(cookies):
test_file_path = result.project.join(
'tests/test_python_boilerplate.py'
)
lines = test_file_path.readlines()
assert "import unittest" in ''.join(lines)
assert "import pytest" not in ''.join(lines)


# def test_project_with_hyphen_in_module_name(cookies):
# result = cookies.bake(
# extra_context={'project_name': 'something-with-a-dash'}
# )
# assert result.project is not None
# project_path = str(result.project)
#
# # when:
# travis_setup_cmd = ('python travis_pypi_setup.py'
# ' --repo audreyr/cookiecutter-pypackage'
# ' --password invalidpass')
# run_inside_dir(travis_setup_cmd, project_path)
#
# # then:
# result_travis_config = yaml.load(
# open(os.path.join(project_path, ".travis.yml"))
# )
# assert "secure" in result_travis_config["deploy"]["password"],\
# "missing password config in .travis.yml"
assert "import unittest" in test_file_path.read()
assert "import pytest" not in test_file_path.read()


def test_bake_with_no_console_script(cookies):
Expand Down