mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 05:56:14 +02:00
Replace pyflakes with flake8 for linting
This commit is contained in:
parent
c5a7d7027c
commit
cdad0d6289
19 changed files with 164 additions and 90 deletions
|
@ -1,13 +1,17 @@
|
|||
# Copyright (C) 2012-2021 jrnl contributors
|
||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
from jrnl.os_compat import on_windows
|
||||
from pytest import mark
|
||||
|
||||
from .fixtures import *
|
||||
from .given_steps import *
|
||||
from .when_steps import *
|
||||
from .then_steps import *
|
||||
from jrnl.os_compat import on_windows
|
||||
|
||||
|
||||
pytest_plugins = [
|
||||
"tests.step_defs.fixtures",
|
||||
"tests.step_defs.given_steps",
|
||||
"tests.step_defs.when_steps",
|
||||
"tests.step_defs.then_steps",
|
||||
]
|
||||
|
||||
|
||||
def pytest_bdd_apply_tag(tag, function):
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# Copyright (C) 2012-2021 jrnl contributors
|
||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import os
|
||||
from collections import defaultdict
|
||||
from keyring import backend
|
||||
from keyring import set_keyring
|
||||
from keyring import errors
|
||||
import os
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
|
||||
from keyring import backend
|
||||
from keyring import errors
|
||||
from keyring import set_keyring
|
||||
from pytest import fixture
|
||||
import toml
|
||||
|
||||
|
@ -59,7 +59,7 @@ class NoKeyring(backend.KeyringBackend):
|
|||
|
||||
|
||||
class FailedKeyring(backend.KeyringBackend):
|
||||
""" A keyring that cannot be retrieved. """
|
||||
"""A keyring that cannot be retrieved."""
|
||||
|
||||
priority = 2
|
||||
|
||||
|
@ -192,11 +192,10 @@ def editor(editor_state):
|
|||
Path(tmpfile).touch()
|
||||
with open(tmpfile, editor_state["intent"]["method"]) as f:
|
||||
# Touch the file so jrnl knows it was edited
|
||||
if editor_state["intent"]["input"] != None:
|
||||
if editor_state["intent"]["input"] is not None:
|
||||
f.write(editor_state["intent"]["input"])
|
||||
|
||||
file_content = f.read()
|
||||
editor_state["tmpfile"]["content"] = file_content
|
||||
|
||||
return _mock_editor
|
||||
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
# Copyright (C) 2012-2021 jrnl contributors
|
||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
from datetime import datetime
|
||||
import json
|
||||
import os
|
||||
from datetime import datetime
|
||||
from keyring import set_keyring
|
||||
import random
|
||||
import string
|
||||
import shutil
|
||||
from unittest.mock import patch
|
||||
import string
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import patch
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from keyring import set_keyring
|
||||
from pytest_bdd import given
|
||||
from pytest_bdd.parsers import parse
|
||||
|
||||
from jrnl import __version__
|
||||
from jrnl.time import __get_pdt_calendar
|
||||
|
||||
from pytest_bdd import given
|
||||
from pytest_bdd.parsers import parse
|
||||
from .fixtures import FailedKeyring
|
||||
from .fixtures import TestKeyring
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
import os
|
||||
|
||||
|
||||
|
||||
def does_directory_contain_files(file_list, directory_path):
|
||||
if not os.path.isdir(directory_path):
|
||||
return False
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
import json
|
||||
import os
|
||||
import re
|
||||
import yaml
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from pytest_bdd import then
|
||||
from pytest_bdd.parsers import parse
|
||||
import yaml
|
||||
|
||||
from jrnl.config import scope_config
|
||||
|
||||
from .helpers import parse_should_or_should_not
|
||||
from .helpers import does_directory_contain_files
|
||||
from .helpers import assert_equal_tags_ignoring_order
|
||||
from .helpers import does_directory_contain_files
|
||||
from .helpers import parse_should_or_should_not
|
||||
|
||||
|
||||
@then("we should get no error")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Copyright (C) 2012-2021 jrnl contributors
|
||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import os
|
||||
from contextlib import ExitStack
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
from pytest_bdd import parsers
|
||||
from pytest_bdd import when
|
||||
from pytest_bdd.parsers import parse
|
||||
from pytest_bdd import parsers
|
||||
|
||||
from jrnl.cli import cli
|
||||
from jrnl.os_compat import split_args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue