@@ -36,7 +36,7 @@ def test_compile_restricted_function():
36
36
safe_locals = {}
37
37
exec (result .code , safe_globals , safe_locals )
38
38
hello_world = safe_locals ['hello_world' ]
39
- assert type (hello_world ) == FunctionType
39
+ assert type (hello_world ) is FunctionType
40
40
assert hello_world () == 'Hello World!\n '
41
41
42
42
@@ -102,7 +102,7 @@ def test_compile_restricted_function_with_arguments():
102
102
safe_locals = {}
103
103
exec (result .code , safe_globals , safe_locals )
104
104
hello_world = safe_locals ['hello_world' ]
105
- assert type (hello_world ) == FunctionType
105
+ assert type (hello_world ) is FunctionType
106
106
assert hello_world ('Hello ' , 'World!' ) == 'Hello World!\n '
107
107
108
108
@@ -136,7 +136,7 @@ def test_compile_restricted_function_can_access_global_variables():
136
136
safe_locals = {}
137
137
exec (result .code , safe_globals , safe_locals )
138
138
hello_world = safe_locals ['hello_world' ]
139
- assert type (hello_world ) == FunctionType
139
+ assert type (hello_world ) is FunctionType
140
140
assert hello_world () == 'Hello World!\n '
141
141
142
142
@@ -165,7 +165,7 @@ def test_compile_restricted_function_pretends_the_code_is_executed_in_a_global_s
165
165
safe_locals = {}
166
166
exec (result .code , safe_globals , safe_locals )
167
167
hello_world = safe_locals ['hello_world' ]
168
- assert type (hello_world ) == FunctionType
168
+ assert type (hello_world ) is FunctionType
169
169
hello_world ()
170
170
assert safe_globals ['output' ] == 'foobar'
171
171
@@ -195,7 +195,7 @@ def test_compile_restricted_function_allows_invalid_python_identifiers_as_functi
195
195
safe_locals = {}
196
196
exec (result .code , safe_globals , safe_locals )
197
197
generated_function = tuple (safe_locals .values ())[0 ]
198
- assert type (generated_function ) == FunctionType
198
+ assert type (generated_function ) is FunctionType
199
199
generated_function ()
200
200
assert safe_globals ['output' ] == 'foobar'
201
201
0 commit comments