Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix files removed via make clean #789

Merged

Conversation

hackebrot
Copy link
Member

We've added a couple of hook backup files as static files to our tests to make sure that they are not accidentally picked up as hooks in templates, see #768.

tests/hooks-backup-files/hooks/post_gen_project.py~
tests/hooks-backup-files/hooks/pre_gen_project.py~

The problem is that make clean removes such files and I have to git reset --hard to restore them as of now. 馃槩

This PR creates the hook files in a pytest.yield_fixture and runs the test against them.

@hackebrot hackebrot added high-priority needs-review PR Only: This PR require review from other developer labels Jul 30, 2016
@codecov-io
Copy link

codecov-io commented Jul 30, 2016

Current coverage is 100% (diff: 100%)

Merging #789 into master will not change coverage

@@           master   #789   diff @@
====================================
  Files          15     15          
  Lines         601    601          
  Methods         0      0          
  Messages        0      0          
  Branches        0      0          
====================================
  Hits          601    601          
  Misses          0      0          
  Partials        0      0          

Sunburst

Powered by Codecov. Last update 0301bf6...cf58e74

@hackebrot
Copy link
Member Author

Anyone? 馃榿

print('pre_gen_project.py~')
"""
)
pre_gen_hook_file = hooks_dir / 'pre_gen_project.py~'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files should be in a hooks directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

In the long run we probably want to change the code to accept a path rather than using the current working directory + hooks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah 馃憤

@hackebrot
Copy link
Member Author

Should be fixed now. 馃槃

@michaeljoseph
Copy link
Contributor

馃憤

@hackebrot hackebrot merged commit a055b4b into cookiecutter:master Aug 17, 2016
@hackebrot hackebrot deleted the fix-files-removed-via-make-clean branch August 17, 2016 18:17
hackebrot added a commit that referenced this pull request Aug 17, 2016
@hackebrot
Copy link
Member Author

Thank you for the review @michaeljoseph! 馃檱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority needs-review PR Only: This PR require review from other developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants