Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logged config location #675

Merged
merged 6 commits into from Aug 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test_settings.py
Expand Up @@ -68,6 +68,23 @@ def test_setup_logging(verbose, log_level):
assert logger.level == log_level


@pytest.mark.parametrize(
"verbose", [True, False],
)
def test_get_config_log_location(tmpdir, capsys, make_settings, verbose):
"""Log the location of the .pypirc config used by the user."""
bhrutledge marked this conversation as resolved.
Show resolved Hide resolved
pypirc = os.path.join(str(tmpdir), ".pypirc")

make_settings(verbose=verbose)

captured = capsys.readouterr()

if verbose:
assert captured.out == f"Using configuration from {pypirc}\n"
else:
assert captured.out == ""


def test_identity_requires_sign():
"""Raise an exception when user provides identity but doesn't require sigining."""
with pytest.raises(exceptions.InvalidSigningConfiguration):
Expand Down
28 changes: 14 additions & 14 deletions tests/test_utils.py
Expand Up @@ -51,20 +51,20 @@ def test_get_config(tmpdir):
}


@pytest.mark.parametrize(
"verbose", [True, False],
)
def test_get_config_log_location(tmpdir, capsys, make_settings, verbose):
"""Log the location of the .pypirc config used by the user."""
pypirc = os.path.join(str(tmpdir), ".pypirc")

make_settings(verbose=verbose)

captured = capsys.readouterr()
if verbose:
assert captured.out == f"Using configuration from {pypirc}\n"
else:
assert captured.out == ""
# @pytest.mark.parametrize(
# "verbose", [True, False],
# )
# def test_get_config_log_location(tmpdir, capsys, make_settings, verbose):
# """Log the location of the .pypirc config used by the user."""
# pypirc = os.path.join(str(tmpdir), ".pypirc")

# make_settings(verbose=verbose)

# captured = capsys.readouterr()
# if verbose:
# assert captured.out == f"Using configuration from {pypirc}\n"
# else:
# assert captured.out == ""


bhrutledge marked this conversation as resolved.
Show resolved Hide resolved
def test_get_config_no_distutils(tmpdir):
Expand Down