summaryrefslogtreecommitdiff
path: root/systemd/test/test_daemon.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-13 16:03:49 -0400
committerGitHub <noreply@github.com>2017-03-13 16:03:49 -0400
commite121ae49abd2821e16710d036fc726ea11c82a0b (patch)
tree1640a25456803db24c5f7bf59ad7911bf94deba4 /systemd/test/test_daemon.py
parent8921c79fb98e5e04c0e2f00813e9d8e015e4206e (diff)
parentc7e393b3ca58013b2afcd02620c64c6fe66d21f4 (diff)
downloadpython-systemd-e121ae49abd2821e16710d036fc726ea11c82a0b.tar.gz
Merge pull request #34 from keszybz/test-skipping
Improve test skipping on old systems.
Diffstat (limited to 'systemd/test/test_daemon.py')
-rw-r--r--systemd/test/test_daemon.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
index c1e08c7..ae76e54 100644
--- a/systemd/test/test_daemon.py
+++ b/systemd/test/test_daemon.py
@@ -243,12 +243,12 @@ def test_listen_fds_default_unset():
assert listen_fds() == []
def test_notify_no_socket():
- assert notify('READY=1') == False
+ assert notify('READY=1') is False
with skip_enosys():
- assert notify('FDSTORE=1', fds=[]) == False
- assert notify('FDSTORE=1', fds=[1,2]) == False
- assert notify('FDSTORE=1', pid=os.getpid()) == False
- assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == False
+ assert notify('FDSTORE=1', fds=[]) is False
+ assert notify('FDSTORE=1', fds=[1, 2]) is False
+ assert notify('FDSTORE=1', pid=os.getpid()) is False
+ assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) is False
if sys.version_info >= (3,):
connection_error = ConnectionRefusedError
@@ -264,7 +264,7 @@ def test_notify_bad_socket():
with skip_enosys():
notify('FDSTORE=1', fds=[])
with pytest.raises(connection_error):
- notify('FDSTORE=1', fds=[1,2])
+ notify('FDSTORE=1', fds=[1, 2])
with pytest.raises(connection_error):
notify('FDSTORE=1', pid=os.getpid())
with pytest.raises(connection_error):
@@ -282,9 +282,9 @@ def test_notify_with_socket(tmpdir):
sock.setsockopt(socket.SOL_SOCKET, SO_PASSCRED, 1)
os.environ['NOTIFY_SOCKET'] = path
- assert notify('READY=1') == True
+ assert notify('READY=1')
with skip_enosys():
- assert notify('FDSTORE=1', fds=[]) == True
- assert notify('FDSTORE=1', fds=[1,2]) == True
- assert notify('FDSTORE=1', pid=os.getpid()) == True
- assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == True
+ assert notify('FDSTORE=1', fds=[])
+ assert notify('FDSTORE=1', fds=[1, 2])
+ assert notify('FDSTORE=1', pid=os.getpid())
+ assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,))