From eaf09801ca85fa3037f0002ea962255bae930f5c Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Fri, 19 Feb 2016 12:47:02 -0800 Subject: [PATCH] Moving logging samples to py.test --- cloud_logging/api/list_logs_test.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/cloud_logging/api/list_logs_test.py b/cloud_logging/api/list_logs_test.py index fc7feb72783..031f0680662 100644 --- a/cloud_logging/api/list_logs_test.py +++ b/cloud_logging/api/list_logs_test.py @@ -12,23 +12,11 @@ # limitations under the License. import re -import unittest import list_logs -import testing -class TestListLogs(testing.CloudTest): - - def test_main(self): - with testing.capture_stdout() as stdout: - list_logs.main(self.config.GCLOUD_PROJECT) - - output = stdout.getvalue().strip() - - self.assertRegexpMatches( - output, re.compile(r'.*', re.S)) - - -if __name__ == '__main__': - unittest.main() +def test_main(cloud_config, capsys): + list_logs.main(cloud_config.GCLOUD_PROJECT) + out, _ = capsys.readouterr() + assert re.search(re.compile(r'.*', re.S), out)