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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove test command in favor of tox #480

Merged

Conversation

hackebrot
Copy link
Member

This PR introduces a better way of running the test suite. Instead of setting up a TestCommand in setup.py it leaves the dependency management for testing to tox. As a consequence I also removed mock from compat.py and setup.py. From what I know, it was solely used in tests (and grep did not report anything else).

The steps to run the test suite are as follows:

$ git clone https://github.com/audreyr/cookiecutter.git
$ cd cookiecutter/
$ mkvirtualenv -a $(pwd) cookiecutter
$ python setup.py develop

$ pip install tox
$ tox

I updated the contributor docs to reflect this behavior, which fixes #466.

Please let me know your thoughts!

Best
Raphael

@hackebrot hackebrot added enhancement This issue/PR relates to a feature request. needs-docs PR Only: This PR require additional documentation needs-review PR Only: This PR require review from other developer labels Jul 29, 2015
@hackebrot hackebrot added this to the 1.1.0 milestone Jul 29, 2015
@codecov-io
Copy link

Current coverage is 95.84%

Merging #480 into master will not affect coverage as of df31ead

@@            master    #480   diff @@
======================================
  Files           12      12       
  Stmts          457     457       
  Branches         0       0       
  Methods          0       0       
======================================
  Hit            438     438       
  Partial          0       0       
  Missed          19      19       

Review entire Coverage Diff


Uncovered Suggestions

  1. +0.88% via cookiecutter/vcs.py#59...62
  2. +0.66% via ...okiecutter/compat.py#70...72
  3. +0.66% via ...okiecutter/compat.py#61...63
  4. See 5 more...

Powered by Codecov

@hackebrot
Copy link
Member Author

@michaeljoseph Do you happen to have time for a review? 😀

{[testenv]deps}
mock
deps = {[testenv]deps}
mock
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this mock dependency?

@hackebrot
Copy link
Member Author

Thank you @michaeljoseph and @pydanny for your thorough review 🙇

From what I know codecov reports the coverage for each of the test envs. If I get rid of --cov in the generic testenv it will stop doing so, I'm afraid. That's why I left this unchanged.

@michaeljoseph
Copy link
Contributor

@hackebrot I meant, the generic testenv should have --cov=cookiecutter instead of --cov cookiecutter?
But it does seem to work as is...

@hackebrot
Copy link
Member Author

I changed the test env command to also reflect the invocation from the official docs. https://pypi.python.org/pypi/pytest-cov

The docs now explain how to run flake8 via tox. However it only checks cookiecutter and ignores tests. We can exclude the dummy test data directories from flake8 though (they cause errors atm).

deps =
{[testenv]deps}
mock
deps = {[testenv]deps}
Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove these sections entirely now right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, Sir! 👌

@michaeljoseph
Copy link
Contributor

👍

@hackebrot
Copy link
Member Author

😤

I'll rebase if you think we are all set here. LGTM

pydanny added a commit that referenced this pull request Aug 1, 2015
…f-tox

Remove test command in favor of tox
@pydanny pydanny merged commit b21cdad into cookiecutter:master Aug 1, 2015
@hackebrot hackebrot deleted the remove-test-command-in-favor-of-tox branch August 1, 2015 20:08
@vincentbernat
Copy link
Contributor

The previous ways of doing things was generic. Due to the way tox works, it is not a general solution as we may wish to be able to test an installed version of cookiecutter without using virtualenv. python setup.py test should be able to test the same environment that python setup.py install configures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request. needs-docs PR Only: This PR require additional documentation needs-review PR Only: This PR require review from other developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instructions for local development are incomplete.
5 participants