Skip to content

Commit

Permalink
couple of flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aschroed committed Nov 7, 2022
1 parent 29bce7f commit 06c3d70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/test_get_field_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_gfi_get_args_required_default():
defaults = {
'type': ['all'],
'key': 'default',
'keyfile': CONFDIR / DEFAULT_KEYPAIR_FILE,
'keyfile': CONFDIR / DEFAULT_KEYPAIR_FILE,
'debug': False,
'nodesc': False,
'comments': False,
Expand Down Expand Up @@ -52,10 +52,12 @@ def test_key_as_dict():
def keydirname():
return './tests/data_files/'


@pytest.fixture
def keydir(keydirname):
return Path(keydirname)


@pytest.fixture
def keyfilename():
return 'keypairs.json'
Expand All @@ -75,6 +77,7 @@ def missing_dirname():
def missing_dir(missing_dirname):
return Path(missing_dirname)


@pytest.mark.file_operation
def test_key_file(keypath):
''' testing when an actual keyfile path is provided as per --keyfile option'''
Expand Down Expand Up @@ -106,7 +109,6 @@ def test_key_from_env_set_wrong(mocker, capsys):
default_keypath = CONFDIR / DEFAULT_KEYPAIR_FILE
baddir = 'some/other/name/'
mocker.patch('wranglertools.get_field_info.os.environ.get', return_value=baddir)
# import pdb; pdb.set_trace()
key = gfi.FDN_Key(default_keypath, 'default')
out = capsys.readouterr()[0]
assert key.error
Expand Down Expand Up @@ -174,6 +176,7 @@ def test_key_error_bad_keyname(capsys):
assert key.error
assert out == "ERROR: No key with name 'nosuchkey' found - check your keypairs file\n"


def bad_connection_will_exit():
with pytest.raises(SystemExit) as excinfo:
keypairs = {
Expand Down
2 changes: 0 additions & 2 deletions tests/test_import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import inspect
import wranglertools.import_data as imp
from tests.conftest import MockedGoogleWorkSheet, MockedGoogleWorkBook, MockedGauth
from gspread.exceptions import GSpreadException

# test data is in conftest.py


Expand Down

0 comments on commit 06c3d70

Please sign in to comment.