Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d16519a

Browse files
authored
[3.11] gh-116858: Add @cpython_only to several tests in test_cmd_line (GH-116859) (#116890)
1 parent 8acd6ca commit d16519a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_cmd_line.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def verify_valid_flag(self, cmd_line):
4141
self.assertNotIn(b'Traceback', err)
4242
return out
4343

44+
@support.cpython_only
4445
def test_help(self):
4546
self.verify_valid_flag('-h')
4647
self.verify_valid_flag('-?')
@@ -51,14 +52,17 @@ def test_help(self):
5152
self.assertNotIn(b'-X dev', out)
5253
self.assertLess(len(lines), 50)
5354

55+
@support.cpython_only
5456
def test_help_env(self):
5557
out = self.verify_valid_flag('--help-env')
5658
self.assertIn(b'PYTHONHOME', out)
5759

60+
@support.cpython_only
5861
def test_help_xoptions(self):
5962
out = self.verify_valid_flag('--help-xoptions')
6063
self.assertIn(b'-X dev', out)
6164

65+
@support.cpython_only
6266
def test_help_all(self):
6367
out = self.verify_valid_flag('--help-all')
6468
lines = out.splitlines()
@@ -77,6 +81,7 @@ def test_optimize(self):
7781
def test_site_flag(self):
7882
self.verify_valid_flag('-S')
7983

84+
@support.cpython_only
8085
def test_version(self):
8186
version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
8287
for switch in '-V', '--version', '-VV':
@@ -142,6 +147,7 @@ def run_python(*args):
142147
else:
143148
self.assertEqual(err, b'')
144149

150+
@support.cpython_only
145151
def test_xoption_frozen_modules(self):
146152
tests = {
147153
('=on', 'FrozenImporter'),
@@ -570,6 +576,7 @@ def test_del___main__(self):
570576
print("del sys.modules['__main__']", file=script)
571577
assert_python_ok(filename)
572578

579+
@support.cpython_only
573580
def test_unknown_options(self):
574581
rc, out, err = assert_python_failure('-E', '-z')
575582
self.assertIn(b'Unknown option: -z', err)
@@ -684,6 +691,7 @@ def run_xdev(self, *args, check_exitcode=True, xdev=True):
684691
self.assertEqual(proc.returncode, 0, proc)
685692
return proc.stdout.rstrip()
686693

694+
@support.cpython_only
687695
def test_xdev(self):
688696
# sys.flags.dev_mode
689697
code = "import sys; print(sys.flags.dev_mode)"
@@ -858,6 +866,7 @@ def test_argv0_normalization(self):
858866
self.assertEqual(proc.returncode, 0, proc)
859867
self.assertEqual(proc.stdout.strip(), b'0')
860868

869+
@support.cpython_only
861870
def test_parsing_error(self):
862871
args = [sys.executable, '-I', '--unknown-option']
863872
proc = subprocess.run(args,

0 commit comments

Comments
 (0)