@@ -38,6 +38,7 @@ def verify_valid_flag(self, cmd_line):
38
38
self .assertNotIn (b'Traceback' , err )
39
39
return out
40
40
41
+ @support .cpython_only
41
42
def test_help (self ):
42
43
self .verify_valid_flag ('-h' )
43
44
self .verify_valid_flag ('-?' )
@@ -48,14 +49,17 @@ def test_help(self):
48
49
self .assertNotIn (b'-X dev' , out )
49
50
self .assertLess (len (lines ), 50 )
50
51
52
+ @support .cpython_only
51
53
def test_help_env (self ):
52
54
out = self .verify_valid_flag ('--help-env' )
53
55
self .assertIn (b'PYTHONHOME' , out )
54
56
57
+ @support .cpython_only
55
58
def test_help_xoptions (self ):
56
59
out = self .verify_valid_flag ('--help-xoptions' )
57
60
self .assertIn (b'-X dev' , out )
58
61
62
+ @support .cpython_only
59
63
def test_help_all (self ):
60
64
out = self .verify_valid_flag ('--help-all' )
61
65
lines = out .splitlines ()
@@ -74,6 +78,7 @@ def test_optimize(self):
74
78
def test_site_flag (self ):
75
79
self .verify_valid_flag ('-S' )
76
80
81
+ @support .cpython_only
77
82
def test_version (self ):
78
83
version = ('Python %d.%d' % sys .version_info [:2 ]).encode ("ascii" )
79
84
for switch in '-V' , '--version' , '-VV' :
@@ -139,6 +144,7 @@ def run_python(*args):
139
144
else :
140
145
self .assertEqual (err , b'' )
141
146
147
+ @support .cpython_only
142
148
def test_xoption_frozen_modules (self ):
143
149
tests = {
144
150
('=on' , 'FrozenImporter' ),
@@ -153,6 +159,7 @@ def test_xoption_frozen_modules(self):
153
159
res = assert_python_ok (* cmd )
154
160
self .assertRegex (res .out .decode ('utf-8' ), expected )
155
161
162
+ @support .cpython_only
156
163
def test_env_var_frozen_modules (self ):
157
164
tests = {
158
165
('on' , 'FrozenImporter' ),
@@ -579,6 +586,7 @@ def test_del___main__(self):
579
586
print ("del sys.modules['__main__']" , file = script )
580
587
assert_python_ok (filename )
581
588
589
+ @support .cpython_only
582
590
def test_unknown_options (self ):
583
591
rc , out , err = assert_python_failure ('-E' , '-z' )
584
592
self .assertIn (b'Unknown option: -z' , err )
@@ -691,6 +699,7 @@ def run_xdev(self, *args, check_exitcode=True, xdev=True):
691
699
self .assertEqual (proc .returncode , 0 , proc )
692
700
return proc .stdout .rstrip ()
693
701
702
+ @support .cpython_only
694
703
def test_xdev (self ):
695
704
# sys.flags.dev_mode
696
705
code = "import sys; print(sys.flags.dev_mode)"
@@ -914,6 +923,7 @@ def test_argv0_normalization(self):
914
923
self .assertEqual (proc .returncode , 0 , proc )
915
924
self .assertEqual (proc .stdout .strip (), b'0' )
916
925
926
+ @support .cpython_only
917
927
def test_parsing_error (self ):
918
928
args = [sys .executable , '-I' , '--unknown-option' ]
919
929
proc = subprocess .run (args ,
0 commit comments