Skip to content

Adds new tutorial about using pytest and code coverage#1739

Merged
webknjaz merged 6 commits intocherrypy:masterfrom
alan412:add-pytest-tutorial
Sep 9, 2018
Merged

Adds new tutorial about using pytest and code coverage#1739
webknjaz merged 6 commits intocherrypy:masterfrom
alan412:add-pytest-tutorial

Conversation

@alan412
Copy link
Copy Markdown
Contributor

@alan412 alan412 commented Sep 6, 2018

Fixes #1731

  • What kind of change does this PR introduce?

    • bug fix
    • feature
    • docs update
    • tests/coverage improvement
    • refactoring
    • other
  • What is the related issue number (starting with #)
    Can't get code coverage to work.... #1731

  • What is the current behavior? (You can also link to an open issue here)
    N/A

  • What is the new behavior (if this is a feature change)?
    N/A

  • Other information:
    This just adds a new tutorial.

  • Checklist:

    • I think the code is well written
    • I wrote good commit messages
    • I have squashed related commits together after the changes have been approved
    • Unit tests for the changes exist
    • Integration tests for the changes exist (if applicable)
    • I used the same coding conventions as the rest of the project
    • The new code doesn't generate linter offenses
    • Documentation reflects the changes
    • The PR relates to only one subject with a clear title
      and description in grammatically correct, complete sentences

if __name__ == '__main__':
cherrypy.quickstart(StringGenerator())

Save this into a file named `tut02.py`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe call it 12?


.. note::

If you don't have pytest installed, you'll need to install it by pip install pytest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use double backticks for command

and extend it with your operations.

Tutorial 12: Using pytest and code coverage
###################################
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

length should match the title itself


To add coverage support to pytest, you'll need to install it by pip install pytest-cov

This tells us that one line is missing. Of course it is because that is only executed when
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's use single space after a period

alan412 and others added 2 commits September 8, 2018 21:10
1) Changed from tut02 naming to tut12
2) Show commands with double backticks
3) Make source RST be same length under section title
4) Changed some spacing after periods to be single spaces.
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 9, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@52d16c4). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1739   +/-   ##
=========================================
  Coverage          ?   78.28%           
=========================================
  Files             ?      104           
  Lines             ?    13317           
  Branches          ?        0           
=========================================
  Hits              ?    10425           
  Misses            ?     2892           
  Partials          ?        0

Copy link
Copy Markdown
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Thanks! It's now going live :)

@webknjaz webknjaz merged commit 35a5d0b into cherrypy:master Sep 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't get code coverage to work....

2 participants