From 92a037684fa1cad7e0dc1008507cf3275856c145 Mon Sep 17 00:00:00 2001 From: Tomer Keren Date: Sun, 13 Jan 2019 21:43:20 +0200 Subject: [PATCH] Fix python2 unicode test error I guess that if you don't have something python2 compliant to say. might as well say nothing at all Also fix linter errors --- tests/unit/conftest.py | 7 ++++--- tests/unit/test_file_checker.py | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index d29c0cd..003a762 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,7 +1,8 @@ -"""Shared fixtures between unit tests""" -import pytest +"""Shared fixtures between unit tests.""" import optparse +import pytest + def options_from(**kwargs): """Generate a Values instances with our kwargs.""" @@ -14,5 +15,5 @@ def options_from(**kwargs): @pytest.fixture def default_options(): - """Fixture returning the default options of flake8""" + """Fixture returning the default options of flake8.""" return options_from() diff --git a/tests/unit/test_file_checker.py b/tests/unit/test_file_checker.py index 3d0992e..c4ee2bf 100644 --- a/tests/unit/test_file_checker.py +++ b/tests/unit/test_file_checker.py @@ -1,8 +1,8 @@ """Unit tests for the FileChecker class.""" import mock import pytest -import flake8 +import flake8 from flake8 import checker @@ -48,8 +48,9 @@ def test_nonexistent_file(): def test_raises_exception_on_failed_plugin(tmp_path, default_options): + """Checks that a failing plugin results in PluginExecutionFailed.""" foobar = tmp_path / 'foobar.py' - foobar.write_text("I exist") + foobar.write_text(u"I exist!") # Create temp file plugin = { "name": "failure", "plugin_name": "failure", # Both are necessary