Skip to content

Commit 34954e2

Browse files
committed
Make linter happy: E721 do not compare types.
1 parent 5aca797 commit 34954e2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_compile_restricted_function.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_compile_restricted_function():
3636
safe_locals = {}
3737
exec(result.code, safe_globals, safe_locals)
3838
hello_world = safe_locals['hello_world']
39-
assert type(hello_world) == FunctionType
39+
assert type(hello_world) is FunctionType
4040
assert hello_world() == 'Hello World!\n'
4141

4242

@@ -102,7 +102,7 @@ def test_compile_restricted_function_with_arguments():
102102
safe_locals = {}
103103
exec(result.code, safe_globals, safe_locals)
104104
hello_world = safe_locals['hello_world']
105-
assert type(hello_world) == FunctionType
105+
assert type(hello_world) is FunctionType
106106
assert hello_world('Hello ', 'World!') == 'Hello World!\n'
107107

108108

@@ -136,7 +136,7 @@ def test_compile_restricted_function_can_access_global_variables():
136136
safe_locals = {}
137137
exec(result.code, safe_globals, safe_locals)
138138
hello_world = safe_locals['hello_world']
139-
assert type(hello_world) == FunctionType
139+
assert type(hello_world) is FunctionType
140140
assert hello_world() == 'Hello World!\n'
141141

142142

@@ -165,7 +165,7 @@ def test_compile_restricted_function_pretends_the_code_is_executed_in_a_global_s
165165
safe_locals = {}
166166
exec(result.code, safe_globals, safe_locals)
167167
hello_world = safe_locals['hello_world']
168-
assert type(hello_world) == FunctionType
168+
assert type(hello_world) is FunctionType
169169
hello_world()
170170
assert safe_globals['output'] == 'foobar'
171171

@@ -195,7 +195,7 @@ def test_compile_restricted_function_allows_invalid_python_identifiers_as_functi
195195
safe_locals = {}
196196
exec(result.code, safe_globals, safe_locals)
197197
generated_function = tuple(safe_locals.values())[0]
198-
assert type(generated_function) == FunctionType
198+
assert type(generated_function) is FunctionType
199199
generated_function()
200200
assert safe_globals['output'] == 'foobar'
201201

0 commit comments

Comments
 (0)