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

Gallopsled / pwntools / 1

11 Jul 2023 10:24PM UTC coverage: 19.327% (-52.2%) from 71.479%
1

push

github

web-flow
shellcraft: more explicit sleep.asm docstring (#2226)

This commit adds information that the sleep shellcraft function does not check if it returned as part of an interrupt and it does not retry the syscall if this occured.

189 of 5940 branches covered (3.18%)

3286 of 17002 relevant lines covered (19.33%)

0.39 hits per line

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

50.0
/pwnlib/testexample.py
1
"""
2
Module-level documentation would go here, along with a general description
3
of the functionality.  You can also add module-level doctests.
4

5
You can see what the documentation for this module will look like here:
6
https://docs.pwntools.com/en/stable/testexample.html
7

8
The tests for this module are run when the documentation is automatically-generated
9
by Sphinx.  This particular module is invoked by an "automodule" directive, which
10
imports everything in the module, or everything listed in ``__all__`` in the module.
11

12
The doctests are automatically picked up by the ``>>>`` symbol, like from
13
the Python prompt.  For more on doctests, see the `Python documentation
14
<https://docs.python.org/2/library/doctest.html>`_.
15

16
All of the syntax in this file is ReStructuredText.  You can find a
17
`nice cheat sheet here <https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst>`_.
18

19
Here's an example of a module-level doctest:
20

21
    >>> add(3, add(2, add(1, 0)))
22
    6
23

24
If doctests are wrong / broken, you can disable them temporarily.
25

26
    >>> add(2, 2) # doctest: +SKIP
27
    5
28

29
Some things in Python are non-deterministic, like ``dict`` or ``set``
30
ordering.  There are a lot of ways to work around this, but the
31
accepted way of doing this is to test for equality.
32

33
    >>> a = {a:a+1 for a in range(3)}
34
    >>> a == {0:1, 1:2, 2:3}
35
    True
36

37
In order to use other modules, they need to be imported from the RST
38
which documents the module.
39

40
    >>> os.path.basename('foo/bar')
41
    'bar'
42

43
"""
44

45
def add(a, b):
2✔
46
    '''add(a, b) -> int
47

48
    Adds the numbers ``a`` and ``b``.
49

50
    Arguments:
51
        a(int): First number to add
52
        b(int): Second number to add
53

54
    Returns:
55
        The sum of ``a`` and ``b``.
56

57
    Examples:
58

59
        >>> add(1,2)
60
        3
61
        >>> add(-1, 33)
62
        32
63
    '''
64
    return a+b
×
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

© 2026 Coveralls, Inc