Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Explicitly mark ellipsis usage in doctests

  • Loading branch information...
commit 24ceb3b23a4da9be12cf71dd4c0ad633c29f2ef2 1 parent 566aa69
@earl authored
Showing with 14 additions and 14 deletions.
  1. +7 −7 TUTORIAL.mkd
  2. +2 −2 beanstalkc.py
  3. +5 −5 test/no-yaml.doctest
View
14 TUTORIAL.mkd
@@ -172,7 +172,7 @@ So let's create another job:
Now we retrieve job-level statistics:
>>> from pprint import pprint
- >>> pprint(job.stats())
+ >>> pprint(job.stats()) # doctest: +ELLIPSIS
{'age': 0,
...
'id': 2,
@@ -185,14 +185,14 @@ If you try to access job stats after the job was deleted, you'll get a
`CommandFailed` exception:
>>> job.delete()
- >>> job.stats()
+ >>> job.stats() # doctest: +ELLIPSIS
Traceback (most recent call last):
...
CommandFailed: ('stats-job', 'NOT_FOUND', [])
Let's have a look at some numbers for the `'default'` tube:
- >>> pprint(beanstalk.stats_tube('default'))
+ >>> pprint(beanstalk.stats_tube('default')) # doctest: +ELLIPSIS
{...
'current-jobs-ready': 0,
'current-jobs-reserved': 0,
@@ -204,7 +204,7 @@ Let's have a look at some numbers for the `'default'` tube:
Finally, there's an abundant amount of server-level statistics accessible via
the `Connection`'s `stats` method. We won't go into details here, but:
- >>> pprint(beanstalk.stats())
+ >>> pprint(beanstalk.stats()) # doctest: +ELLIPSIS
{...
'current-connections': 1,
'current-jobs-buried': 0,
@@ -343,7 +343,7 @@ requests on unreserved jobs are silently ignored:
You can, though, delete a job that was not reserved by you:
>>> job.delete()
- >>> job.stats()
+ >>> job.stats() # doctest: +ELLIPSIS
Traceback (most recent call last):
...
CommandFailed: ('stats-job', 'NOT_FOUND', [])
@@ -444,7 +444,7 @@ when creating the `Connection`:
>>> beanstalk.tubes()
'---\n- default\n'
- >>> beanstalk.stats_tube('default')
+ >>> beanstalk.stats_tube('default') # doctest: +ELLIPSIS
'---\nname: default\ncurrent-jobs-urgent: 0\ncurrent-jobs-ready: 0\n...'
>>> beanstalk.close()
@@ -462,7 +462,7 @@ Alternatively, you can also pass a function to be used as YAML parser:
>>> beanstalk.tubes()
['---', '- default', '']
- >>> beanstalk.stats_tube('default')
+ >>> beanstalk.stats_tube('default') # doctest: +ELLIPSIS
['---', 'name: default', 'current-jobs-urgent: 0', ...]
>>> beanstalk.close()
View
4 beanstalkc.py
@@ -289,7 +289,7 @@ def stats(self):
pid = os.spawnlp(os.P_NOWAIT,
'beanstalkd',
'beanstalkd', '-l', '127.0.0.1', '-p', '14711')
- doctest.testfile('TUTORIAL.mkd', optionflags=doctest.ELLIPSIS)
- doctest.testfile('test/no-yaml.doctest', optionflags=doctest.ELLIPSIS)
+ doctest.testfile('TUTORIAL.mkd')
+ doctest.testfile('test/no-yaml.doctest')
finally:
os.kill(pid, signal.SIGTERM)
View
10 test/no-yaml.doctest
@@ -21,13 +21,13 @@ automatically maintain the released/buried Job's priority:
>>> jid = beanstalk.put('foo', priority=42)
>>> job = beanstalk.reserve()
- >>> print repr(job.stats())
+ >>> print repr(job.stats()) # doctest: +ELLIPSIS
'...pri: 42...'
>>> job.release() # Succeeds, but ...
- >>> job = beanstalk.reserve()
- >>> print repr(job.stats()) # ... may not do what you want.
+ >>> job = beanstalk.reserve() # ... may not do what you want.
+ >>> print repr(job.stats()) # doctest: +ELLIPSIS
'...pri: 2147483648...'
>>> job.delete()
@@ -37,12 +37,12 @@ Same for Job#bury:
>>> jid = beanstalk.put('bar', priority=42)
>>> job = beanstalk.reserve()
- >>> print repr(job.stats())
+ >>> print repr(job.stats()) # doctest: +ELLIPSIS
'...pri: 42...'
>>> job.bury()
- >>> print repr(beanstalk.stats_job(jid))
+ >>> print repr(beanstalk.stats_job(jid)) # doctest: +ELLIPSIS
'...pri: 2147483648...'
And that was that.
Please sign in to comment.
Something went wrong with that request. Please try again.