Write a test checking plugin failure exception handling

This commit is contained in:
Tomer Keren 2019-01-13 21:24:44 +02:00 committed by Anthony Sottile
parent c68e7a8d3e
commit b64421c5e8
2 changed files with 35 additions and 0 deletions

17
tests/unit/conftest.py Normal file
View file

@ -0,0 +1,17 @@
"""Shared fixtures between unit tests"""
import pytest
import optparse
def options_from(**kwargs):
"""Generate a Values instances with our kwargs."""
kwargs.setdefault('hang_closing', True)
kwargs.setdefault('max_line_length', 79)
kwargs.setdefault('verbose', False)
kwargs.setdefault('stdin_display_name', 'stdin')
return optparse.Values(kwargs)
@pytest.fixture
def default_options():
"""Fixture returning the default options of flake8"""
return options_from()