summaryrefslogtreecommitdiff
path: root/systemd/journal.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-14 23:35:42 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-15 20:57:44 -0500
commit5d1e3fbcdcb03bf1c13cb9bd01b9d6bb62f776d9 (patch)
tree6f98c285c1503af15cd8fa7be4db27d90a0d3516 /systemd/journal.py
parent930bf897969cf7a98b845bef60653cdf2edc4355 (diff)
downloadpython-systemd-5d1e3fbcdcb03bf1c13cb9bd01b9d6bb62f776d9.tar.gz
tests: skip journal.stream tests on ENOENT error
When running in a chroot, doctests that called journal.stream would fail with ENOENT. Move the tests to test_journal, where we can skip tests properly (without uglyfying the documentation). Fixes #32.
Diffstat (limited to 'systemd/journal.py')
-rw-r--r--systemd/journal.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/systemd/journal.py b/systemd/journal.py
index e9f714e..41ffbdc 100644
--- a/systemd/journal.py
+++ b/systemd/journal.py
@@ -456,8 +456,8 @@ def stream(identifier=None, priority=LOG_INFO, level_prefix=False):
newline character is written.
>>> from systemd import journal
- >>> stream = journal.stream('myapp')
- >>> res = stream.write('message...\n')
+ >>> stream = journal.stream('myapp') # doctest: +SKIP
+ >>> res = stream.write('message...\n') # doctest: +SKIP
will produce the following message in the journal::
@@ -470,8 +470,8 @@ def stream(identifier=None, priority=LOG_INFO, level_prefix=False):
This interface can be used conveniently with the print function:
>>> from __future__ import print_function
- >>> fileobj = journal.stream()
- >>> print('message...', file=fileobj) # doctest: +SKIP
+ >>> stream = journal.stream() # doctest: +SKIP
+ >>> print('message...', file=stream) # doctest: +SKIP
priority is the syslog priority, one of `LOG_EMERG`, `LOG_ALERT`,
`LOG_CRIT`, `LOG_ERR`, `LOG_WARNING`, `LOG_NOTICE`, `LOG_INFO`, `LOG_DEBUG`.