mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-24 08:14:13 +03:00
Some minor refactorings in tests
This commit is contained in:
parent
bb1805993e
commit
d689197c2b
|
@ -132,8 +132,7 @@ def check_paths(paths):
|
|||
|
||||
for line in open(path, "r"):
|
||||
match = RE_OBJ.search(line)
|
||||
msg = "cookiecutter variable not replaced in {}"
|
||||
assert match is None, msg.format(path)
|
||||
assert match is None, f"cookiecutter variable not replaced in {path}"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
||||
|
@ -189,7 +188,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip
|
|||
|
||||
with open(f"{result.project}/.travis.yml", "r") as travis_yml:
|
||||
try:
|
||||
yml = yaml.load(travis_yml, Loader=yaml.FullLoader)["jobs"]["include"]
|
||||
yml = yaml.safe_load(travis_yml)["jobs"]["include"]
|
||||
assert yml[0]["script"] == ["flake8"]
|
||||
assert yml[1]["script"] == [expected_test_script]
|
||||
except yaml.YAMLError as e:
|
||||
|
@ -213,7 +212,7 @@ def test_gitlab_invokes_flake8_and_pytest(
|
|||
|
||||
with open(f"{result.project}/.gitlab-ci.yml", "r") as gitlab_yml:
|
||||
try:
|
||||
gitlab_config = yaml.load(gitlab_yml, Loader=yaml.FullLoader)
|
||||
gitlab_config = yaml.safe_load(gitlab_yml)
|
||||
assert gitlab_config["flake8"]["script"] == ["flake8"]
|
||||
assert gitlab_config["pytest"]["script"] == [expected_test_script]
|
||||
except yaml.YAMLError as e:
|
||||
|
|
Loading…
Reference in New Issue
Block a user