Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Wilhelm authored and Florian Wilhelm committed Mar 20, 2015
1 parent f98dc80 commit ffbf76a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pyscaffold/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,17 @@ def main(args):
# Set additional attributes of args
if args.update:
args = info.project(args)
if args.numpydoc:
utils.safe_set(args, 'numpydoc_sphinx_ext', ", 'numpydoc'")
if args.namespace:
args.namespace = prepare_namespace(args.namespace)
args = structure.set_default_args(args)
# Apply some preprocessing
if args.cookiecutter_template:
structure.create_cookiecutter(args)
args.force = True
if args.django:
structure.create_django_proj(args)
args.requirements.append('django')
if args.numpydoc:
utils.safe_set(args, 'numpydoc_sphinx_ext', ", 'numpydoc'")
else:
utils.safe_set(args, 'numpydoc_sphinx_ext', "")
if args.namespace:
args.namespace = prepare_namespace(args.namespace)
# Convert list of
proj_struct = structure.make_structure(args)
structure.create_structure(proj_struct, update=args.update or args.force)
Expand Down
1 change: 1 addition & 0 deletions pyscaffold/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def create_cookiecutter(args):
cookiecutter(args.cookiecutter_template,
no_input=True,
extra_context=extra_context)
args.force = True


def check_files_exist(struct, prefix=None):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_create_structure_when_dir_exists(tmpdir): # noqa
def test_make_structure():
args = ["project", "-p", "package", "-d", "description"]
args = runner.parse_args(args)
args = structure.set_default_args(args)
struct = structure.make_structure(args)
assert isinstance(struct, dict)

Expand All @@ -84,6 +85,7 @@ def test_make_structure_with_pre_commit_hooks():
"-d", "description",
"--with-pre-commit"]
args = runner.parse_args(args)
args = structure.set_default_args(args)
struct = structure.make_structure(args)
assert isinstance(struct, dict)
assert ".pre-commit-config.yaml" in struct["project"]
Expand All @@ -95,6 +97,7 @@ def test_make_structure_with_tox():
"-d", "description",
"--with-tox"]
args = runner.parse_args(args)
args = structure.set_default_args(args)
struct = structure.make_structure(args)
assert isinstance(struct, dict)
assert "tox.ini" in struct["project"]
Expand Down

0 comments on commit ffbf76a

Please sign in to comment.