Swap to flake8

master
Tom Wilson 6 years ago
parent f7ac5ef0c3
commit 80bed09889

@ -1,2 +1,2 @@
from .specification import * from .specification import * # noqa
from .manager import * from .manager import * # noqa

@ -37,7 +37,7 @@ TOML files would fail::
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from preserve import preservable, restore from preserve import preservable
class InvalidConfigError(Exception): class InvalidConfigError(Exception):

@ -1,2 +1,3 @@
[pytest] [pytest]
pep8maxlinelength = 99 addopts = --flake8
flake8-max-line-length = 99

@ -17,8 +17,9 @@ setup(name='config-spec',
'pylint', 'pylint',
'autopep8', 'autopep8',
'pytest', 'pytest',
'pytest-pep8', 'pytest-flake8',
'pytest-cov' 'pytest-cov',
'pytest-sugar'
] ]
}, },
long_description=open('README.md').read(), long_description=open('README.md').read(),

@ -1,20 +0,0 @@
import pytest
import configspec
from copy import deepcopy
from test_configspec import example_spec, example_values
def test_man(example_spec, example_values):
confman = configspec.ConfigManager()
confman.add_confspec("test_bundle", example_spec)
confman.load({"test_bundle": example_values})
assert confman.get_config_bundle("test_bundle") == example_values
confman.freeze_value("test_bundle", "int_a")
newvals = deepcopy(example_values)
newvals["int_a"] = 4
confman.load({"test_bundle": newvals})
assert confman.get_config_bundle("test_bundle") == example_values
confman.load_overlay({"test_bundle": {"string_a": "new text"}})
assert confman.get_config_bundle("test_bundle")["string_a"] == "new text"

@ -1,7 +1,6 @@
import pytest import pytest
import configspec import configspec
from copy import deepcopy
# Test each def type, both pass and fail
@pytest.fixture @pytest.fixture
@ -100,4 +99,17 @@ def test_invalid_string():
spec.validate(None) spec.validate(None)
# Test manager, load, overlay, freeze def test_man(example_spec, example_values):
confman = configspec.ConfigManager()
confman.add_confspec("test_bundle", example_spec)
confman.load({"test_bundle": example_values})
assert confman.get_config_bundle("test_bundle") == example_values
confman.freeze_value("test_bundle", "int_a")
newvals = deepcopy(example_values)
newvals["int_a"] = 4
confman.load({"test_bundle": newvals})
assert confman.get_config_bundle("test_bundle") == example_values
confman.load_overlay({"test_bundle": {"string_a": "new text"}})
assert confman.get_config_bundle("test_bundle")["string_a"] == "new text"

Loading…
Cancel
Save