Skip to content

Commit 51fe4f0

Browse files
author
Jon Wayne Parrott
committed
Merge pull request #194 from GoogleCloudPlatform/pytest-logging
Moving logging samples to py.test
2 parents 64812dd + eaf0980 commit 51fe4f0

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

cloud_logging/api/list_logs_test.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,11 @@
1212
# limitations under the License.
1313

1414
import re
15-
import unittest
1615

1716
import list_logs
18-
import testing
1917

2018

21-
class TestListLogs(testing.CloudTest):
22-
23-
def test_main(self):
24-
with testing.capture_stdout() as stdout:
25-
list_logs.main(self.config.GCLOUD_PROJECT)
26-
27-
output = stdout.getvalue().strip()
28-
29-
self.assertRegexpMatches(
30-
output, re.compile(r'.*', re.S))
31-
32-
33-
if __name__ == '__main__':
34-
unittest.main()
19+
def test_main(cloud_config, capsys):
20+
list_logs.main(cloud_config.GCLOUD_PROJECT)
21+
out, _ = capsys.readouterr()
22+
assert re.search(re.compile(r'.*', re.S), out)

0 commit comments

Comments
 (0)