Fix flake8 errors in tests

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2013-04-06 21:22:35 +02:00
parent ae7d2ee845
commit 78133500cb
5 changed files with 18 additions and 20 deletions

View File

@ -1,6 +1,6 @@
# #
import hy import hy # noqa
from .native_tests.math import * from .native_tests.math import * # noqa
from .native_tests.language import * from .native_tests.language import * # noqa

View File

@ -258,17 +258,17 @@ def test_ast_expression_basics():
""" Ensure basic AST expression conversion works. """ """ Ensure basic AST expression conversion works. """
code = hy_compile(tokenize("(foo bar)")).body[0] code = hy_compile(tokenize("(foo bar)")).body[0]
tree = ast.Expr(value=ast.Call( tree = ast.Expr(value=ast.Call(
func=ast.Name( func=ast.Name(
id="foo", id="foo",
ctx=ast.Load(), ctx=ast.Load(),
), ),
args=[ args=[
ast.Name(id="bar", ctx=ast.Load()) ast.Name(id="bar", ctx=ast.Load())
], ],
keywords=[], keywords=[],
starargs=None, starargs=None,
kwargs=None, kwargs=None,
)) ))
_ast_spotcheck("value.func.id", code, tree) _ast_spotcheck("value.func.id", code, tree)

View File

@ -4,8 +4,8 @@ import ast
def test_basics(): def test_basics():
"Make sure the basics of the importer work" "Make sure the basics of the importer work"
module = import_file_to_module("basic", import_file_to_module("basic",
"tests/resources/importer/basic.hy") "tests/resources/importer/basic.hy")
def test_stringer(): def test_stringer():

View File

@ -32,13 +32,13 @@ from hy.lex import tokenize
def test_lex_exception(): def test_lex_exception():
""" Ensure tokenize throws a fit on a partial input """ """ Ensure tokenize throws a fit on a partial input """
try: try:
objs = tokenize("(foo") tokenize("(foo")
assert True is False assert True is False
except LexException: except LexException:
pass pass
try: try:
objs = tokenize("&foo&") tokenize("&foo&")
assert True is False assert True is False
except LexException: except LexException:
pass pass

View File

@ -2,9 +2,7 @@
from hy.macros import macro, process from hy.macros import macro, process
from hy.lex import tokenize from hy.lex import tokenize
from hy.models.expression import HyExpression
from hy.models.string import HyString from hy.models.string import HyString
from hy.models.symbol import HySymbol
from hy.models.list import HyList from hy.models.list import HyList