diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-01-04 14:19:44 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-01-04 14:19:44 +0100 |
commit | 633770eea2eb7591f571c44506364f965c8f8147 (patch) | |
tree | 572621b1638922e8095ed83e2fc21d5ab2cfe097 | |
parent | 19683bcf6ad7be8a3b814d63a8180040dd8090f5 (diff) | |
download | udisks-633770eea2eb7591f571c44506364f965c8f8147.tar.gz |
integration-test: Fix wait_timeout/busy error messages
Turn write_stderr() into a classmethod, so that we can call it from
classmethods.
-rwxr-xr-x | src/tests/integration-test | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tests/integration-test b/src/tests/integration-test index d476689..fa38db2 100755 --- a/src/tests/integration-test +++ b/src/tests/integration-test @@ -197,7 +197,7 @@ class UDisksTestCase(unittest.TestCase): time.sleep(0.1) timeout -= 1 if timeout <= 0: - self.write_stderr('[wait timeout!] ') + klass.write_stderr('[wait timeout!] ') @classmethod def zero_device(klass): @@ -329,7 +329,7 @@ class UDisksTestCase(unittest.TestCase): except GLib.GError as e: if 'UDisks2.Error.DeviceBusy' not in e.message: raise - self.write_stderr('[busy] ') + klass.write_stderr('[busy] ') time.sleep(0.3) timeout -= 1 @@ -492,7 +492,8 @@ class UDisksTestCase(unittest.TestCase): self.assertEventually(lambda: obj.get_property(name), value) - def write_stderr(self, msg): + @classmethod + def write_stderr(klass, msg): '''Write to stderr without buffering''' sys.stderr.write(msg) sys.stderr.flush() |