Skip to content

Commit

Permalink
Merge pull request #194 from GoogleCloudPlatform/pytest-logging
Browse files Browse the repository at this point in the history
Moving logging samples to py.test
  • Loading branch information
Jon Wayne Parrott committed Feb 19, 2016
2 parents 64812dd + eaf0980 commit 51fe4f0
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions cloud_logging/api/list_logs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 51fe4f0

Please sign in to comment.