Skip to content

Commit 32c7751

Browse files
authored
[3.12] gh-116858: Add @cpython_only to several tests in test_cmd_line (GH-116859) (#116889)
1 parent ccea6e8 commit 32c7751

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
@@ -38,6 +38,7 @@ def verify_valid_flag(self, cmd_line):
3838
self.assertNotIn(b'Traceback', err)
3939
return out
4040

41+
@support.cpython_only
4142
def test_help(self):
4243
self.verify_valid_flag('-h')
4344
self.verify_valid_flag('-?')
@@ -48,14 +49,17 @@ def test_help(self):
4849
self.assertNotIn(b'-X dev', out)
4950
self.assertLess(len(lines), 50)
5051

52+
@support.cpython_only
5153
def test_help_env(self):
5254
out = self.verify_valid_flag('--help-env')
5355
self.assertIn(b'PYTHONHOME', out)
5456

57+
@support.cpython_only
5558
def test_help_xoptions(self):
5659
out = self.verify_valid_flag('--help-xoptions')
5760
self.assertIn(b'-X dev', out)
5861

62+
@support.cpython_only
5963
def test_help_all(self):
6064
out = self.verify_valid_flag('--help-all')
6165
lines = out.splitlines()
@@ -74,6 +78,7 @@ def test_optimize(self):
7478
def test_site_flag(self):
7579
self.verify_valid_flag('-S')
7680

81+
@support.cpython_only
7782
def test_version(self):
7883
version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
7984
for switch in '-V', '--version', '-VV':
@@ -139,6 +144,7 @@ def run_python(*args):
139144
else:
140145
self.assertEqual(err, b'')
141146

147+
@support.cpython_only
142148
def test_xoption_frozen_modules(self):
143149
tests = {
144150
('=on', 'FrozenImporter'),
@@ -567,6 +573,7 @@ def test_del___main__(self):
567573
print("del sys.modules['__main__']", file=script)
568574
assert_python_ok(filename)
569575

576+
@support.cpython_only
570577
def test_unknown_options(self):
571578
rc, out, err = assert_python_failure('-E', '-z')
572579
self.assertIn(b'Unknown option: -z', err)
@@ -681,6 +688,7 @@ def run_xdev(self, *args, check_exitcode=True, xdev=True):
681688
self.assertEqual(proc.returncode, 0, proc)
682689
return proc.stdout.rstrip()
683690

691+
@support.cpython_only
684692
def test_xdev(self):
685693
# sys.flags.dev_mode
686694
code = "import sys; print(sys.flags.dev_mode)"
@@ -855,6 +863,7 @@ def test_argv0_normalization(self):
855863
self.assertEqual(proc.returncode, 0, proc)
856864
self.assertEqual(proc.stdout.strip(), b'0')
857865

866+
@support.cpython_only
858867
def test_parsing_error(self):
859868
args = [sys.executable, '-I', '--unknown-option']
860869
proc = subprocess.run(args,

0 commit comments

Comments
 (0)