Skip to content

Commit 76e68ee

Browse files
committed
gh-131178: Add tests for this command-line interface
1 parent 082ac30 commit 76e68ee

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lib/test/test_this.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import unittest
2+
3+
from test.support import requires_subprocess
4+
from test.support.script_helper import assert_python_ok
5+
6+
7+
@requires_subprocess()
8+
class CommandLineTest(unittest.TestCase):
9+
def test_this_module(self):
10+
rc, stdout, stderr = assert_python_ok('-m', 'this')
11+
self.assertEqual(rc, 0)
12+
self.assertIn(b'The Zen of Python', stdout)
13+
14+
15+
if __name__ == "__main__":
16+
unittest.main()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add tests for ``this`` command-line interface.

0 commit comments

Comments
 (0)