Skip to content

Commit

Permalink
fixed some pep8 and flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwlouse committed Jun 16, 2015
1 parent 8d6ff29 commit 3befbe5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions sacred/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

__sacred__ = True # marks files that should be filtered from stack traces


@wrapt.decorator
def optional_kwargs_decorator(wrapped, instance, args, kwargs):
def _decorated(func):
Expand Down
4 changes: 4 additions & 0 deletions sacred/ingredients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
from __future__ import division, print_function, unicode_literals
import sacred.optional as opt

__all__ = ['whet']

if opt.has_whetlab:
from sacred.ingredients.whetlab import whet
else:
whet = opt.MissingDependencyMock('whetlab')
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
universal=1
[pytest]
pep8ignore =
tests/test_config_scope.py ALL # Lots of errors that need to be there for testing
tests/test_config/test_config_scope.py ALL # Lots of errors that need to be there for testing
build/* ALL
dist/* ALL
sacred.egg-info/* ALL
[flake8]
ignore = D100,D101,D102,D103
exclude = sacred/ingredients/*
2 changes: 1 addition & 1 deletion tests/test_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from __future__ import division, print_function, unicode_literals
7 changes: 3 additions & 4 deletions tests/test_config/test_config_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def ignored2():

ignored3 = int


cfg()
return cfg

Expand All @@ -45,7 +44,7 @@ def test_result_of_config_scope_is_dict(conf_scope):
def test_result_of_config_scope_contains_keys(conf_scope):
cfg = conf_scope()
assert set(cfg.keys()) == {'a', 'b', 'c', 'd', 'e', 'f',
'composit1', 'composit2', 'deriv'}
'composit1', 'composit2', 'deriv'}

assert cfg['a'] == 1
assert cfg['b'] == 2.0
Expand Down Expand Up @@ -81,8 +80,8 @@ def test_adding_values(conf_scope):
def test_typechange(conf_scope):
cfg = conf_scope({'a': 'bar', 'b': 'foo', 'c': 1})
assert cfg.typechanged == {'a': (int, type('bar')),
'b': (float, type('foo')),
'c': (bool, int)}
'b': (float, type('foo')),
'c': (bool, int)}


def test_nested_typechange(conf_scope):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def test_optional_import():
def test_optional_import_nonexisting():
has_nonex, nonex = optional_import('clearlynonexistingpackage')
assert not has_nonex
assert nonex is None
assert nonex is None

0 comments on commit 3befbe5

Please sign in to comment.