• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

POptUS / template_repo / 8647290782

11 Apr 2024 01:10PM CUT coverage: 100.0% (+3.7%) from 96.319%
8647290782

Pull #5

github

jared321
Include links to examples.
Pull Request #5: DRAFT: Improvements based on recent experiences

39 of 39 new or added lines in 11 files covered. (100.0%)

182 of 182 relevant lines covered (100.0%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/mytemplate_pypkg/src/mytemplate/examples/run_my_example.py
1
import mytemplate
1✔
2

3

4
def run_my_example():
1✔
5
    """
6
    This is a function that serves as an example/tutorial that we would point
7
    people toward to help them learn and understand our interface.
8

9
    Given this special role, we want to know at all times that it runs through
10
    and produces correct results.  In this case, by including this example in
11
    the repo we can also package it up inside a unittest TestCase (see
12
    tests/TestExample).  Part of this double role is that the example can
13
    function as a pass/fail system-level test in our suite.
14

15
    Since this function is written outside of the unittest framework, it cannot
16
    use any of the self.assert* routines.  Testing should be via assert
17
    statements, which are trapped by the TestCase wrapper and registered with
18
    the framework as a failure.
19
    """
20
    x = 1.1
1✔
21
    y = mytemplate.compute(x)
1✔
22

23
    print()
1✔
24
    print(f"compute gave me {y} for input {x}")
1✔
25
    print()
1✔
26
    assert y == 5.5
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc