Skip to content

Commit c5bb466

Browse files
sobolevndiegorusso
authored andcommitted
pythongh-116858: Add @cpython_only to several tests in test_cmd_line (python#116859)
1 parent 3dae21b commit c5bb466

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_cmd_line.py

+10
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'),
@@ -153,6 +159,7 @@ def test_xoption_frozen_modules(self):
153159
res = assert_python_ok(*cmd)
154160
self.assertRegex(res.out.decode('utf-8'), expected)
155161

162+
@support.cpython_only
156163
def test_env_var_frozen_modules(self):
157164
tests = {
158165
('on', 'FrozenImporter'),
@@ -579,6 +586,7 @@ def test_del___main__(self):
579586
print("del sys.modules['__main__']", file=script)
580587
assert_python_ok(filename)
581588

589+
@support.cpython_only
582590
def test_unknown_options(self):
583591
rc, out, err = assert_python_failure('-E', '-z')
584592
self.assertIn(b'Unknown option: -z', err)
@@ -691,6 +699,7 @@ def run_xdev(self, *args, check_exitcode=True, xdev=True):
691699
self.assertEqual(proc.returncode, 0, proc)
692700
return proc.stdout.rstrip()
693701

702+
@support.cpython_only
694703
def test_xdev(self):
695704
# sys.flags.dev_mode
696705
code = "import sys; print(sys.flags.dev_mode)"
@@ -914,6 +923,7 @@ def test_argv0_normalization(self):
914923
self.assertEqual(proc.returncode, 0, proc)
915924
self.assertEqual(proc.stdout.strip(), b'0')
916925

926+
@support.cpython_only
917927
def test_parsing_error(self):
918928
args = [sys.executable, '-I', '--unknown-option']
919929
proc = subprocess.run(args,

0 commit comments

Comments
 (0)