Skip to content

Commit

Permalink
Make linter happy: E721 do not compare types.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Aug 25, 2023
1 parent 5aca797 commit 34954e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_compile_restricted_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_compile_restricted_function():
safe_locals = {}
exec(result.code, safe_globals, safe_locals)
hello_world = safe_locals['hello_world']
assert type(hello_world) == FunctionType
assert type(hello_world) is FunctionType
assert hello_world() == 'Hello World!\n'


Expand Down Expand Up @@ -102,7 +102,7 @@ def test_compile_restricted_function_with_arguments():
safe_locals = {}
exec(result.code, safe_globals, safe_locals)
hello_world = safe_locals['hello_world']
assert type(hello_world) == FunctionType
assert type(hello_world) is FunctionType
assert hello_world('Hello ', 'World!') == 'Hello World!\n'


Expand Down Expand Up @@ -136,7 +136,7 @@ def test_compile_restricted_function_can_access_global_variables():
safe_locals = {}
exec(result.code, safe_globals, safe_locals)
hello_world = safe_locals['hello_world']
assert type(hello_world) == FunctionType
assert type(hello_world) is FunctionType
assert hello_world() == 'Hello World!\n'


Expand Down Expand Up @@ -165,7 +165,7 @@ def test_compile_restricted_function_pretends_the_code_is_executed_in_a_global_s
safe_locals = {}
exec(result.code, safe_globals, safe_locals)
hello_world = safe_locals['hello_world']
assert type(hello_world) == FunctionType
assert type(hello_world) is FunctionType
hello_world()
assert safe_globals['output'] == 'foobar'

Expand Down Expand Up @@ -195,7 +195,7 @@ def test_compile_restricted_function_allows_invalid_python_identifiers_as_functi
safe_locals = {}
exec(result.code, safe_globals, safe_locals)
generated_function = tuple(safe_locals.values())[0]
assert type(generated_function) == FunctionType
assert type(generated_function) is FunctionType
generated_function()
assert safe_globals['output'] == 'foobar'

Expand Down

0 comments on commit 34954e2

Please sign in to comment.