Skip to content

Commit

Permalink
Test on Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
koterpillar committed Apr 14, 2017
1 parent 8c9f92b commit c62dadf
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"

install:
- pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion aloe/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def multi_manager(*managers):
Returns a tuple with all the manager results.
"""

if len(managers) == 0:
if not managers:
source = dedent(
"""
def null_manager(*args, **kwargs):
Expand Down
3 changes: 0 additions & 3 deletions aloe/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,12 @@ def parse(cls, string=None, filename=None, language=None):
"""

parser = Parser()
# pylint:disable=redefined-variable-type
# https://bitbucket.org/logilab/pylint/issues/710
if language:
if language == 'pt-br':
language = 'pt'
token_matcher = LanguageTokenMatcher(language)
else:
token_matcher = TokenMatcher()
# pylint:enable=redefined-variable-type

if string:
token_scanner = TokenScanner(string=string)
Expand Down
4 changes: 2 additions & 2 deletions aloe/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def configure(self, options, conf):
super().configure(options, conf)

module_name, class_name = options.test_class_name.rsplit('.', 1)
module = import_module(module_name)
self.test_class = getattr(module, class_name)
test_class_module = import_module(module_name)
self.test_class = getattr(test_class_module, class_name)
self.ignore_python = options.ignore_python

conf.force_color = options.force_color
Expand Down
2 changes: 1 addition & 1 deletion aloe/testclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def make_steps(cls, step_container, steps,
in the feature file.
"""

assert len(steps) > 0
assert steps

step_definitions = [
cls.prepare_step(step)
Expand Down
4 changes: 2 additions & 2 deletions aloe/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def __init__(self, *args, **kwargs):

super().__init__(*args, **kwargs)

def makeConfig(self, *args, **kwargs):
config = super().makeConfig(*args, **kwargs)
def makeConfig(self, env, plugins=None):
config = super().makeConfig(env, plugins=plugins)

if self.stream:
config.stream = self.stream
Expand Down
6 changes: 2 additions & 4 deletions aloe/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def guess_types(data): # pylint:disable=too-complex
data = data.decode()

if isinstance(data, str):
# pylint:disable=redefined-variable-type
if data == "true":
data = True
elif data == "false":
Expand All @@ -62,7 +61,6 @@ def guess_types(data): # pylint:disable=too-complex
pass

return data
# pylint:enable=redefined-variable-type

# if it's a dict, recurse as a dict
if isinstance(data, dict):
Expand Down Expand Up @@ -105,7 +103,7 @@ def inner(*args, **kwargs):
so replace it with a no-op.
"""

def generator():
def generator_func():
"""
Hide the generator in a separate function
because Python 2 can't support "returning from generators"
Expand All @@ -121,7 +119,7 @@ def generator():
entered[0] = False

if inspect.isgeneratorfunction(func):
return generator()
return generator_func()
else:
if not entered[0]:
try:
Expand Down
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ disable=
locally-disabled,
locally-enabled,
missing-super-argument,
no-else-return,
no-self-use,
too-few-public-methods,
too-many-lines,
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ coverage
factory_boy
mock
pep8
pylint>=1.5.1
pylint>=1.7.0
pylint-mccabe
setuptools_scm
Sphinx
2 changes: 1 addition & 1 deletion tests/unit/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def __call__(self):
no_step = NoStep()
steps.load_steps(no_step)

assert len(steps) == 0
assert not steps


def test_unload_reload():
Expand Down

0 comments on commit c62dadf

Please sign in to comment.