Skip to content

Commit

Permalink
Add coverage for _get_config_var
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Oct 1, 2019
1 parent 0da86bb commit 3116ef0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# for complete details.

import collections
import logging

try:
import ctypes
Expand Down Expand Up @@ -556,6 +557,25 @@ def test_glibc_version_string_ctypes_missing(monkeypatch):
assert tags._glibc_version_string_ctypes() is None


def test_get_config_var_does_not_log(monkeypatch):
debug = pretend.call_recorder(lambda *a: None)
monkeypatch.setattr(tags.logger, "debug", debug)
tags._get_config_var('missing')
assert debug.calls == []


def test_get_config_var_does_not_log(monkeypatch):
debug = pretend.call_recorder(lambda *a: None)
monkeypatch.setattr(tags.logger, "debug", debug)
tags._get_config_var('missing', warn=True)
assert debug.calls == [
pretend.call(
"Config variable '%s' is unset, Python ABI tag may be incorrect",
"missing",
),
]


def test_have_compatible_glibc(monkeypatch):
if platform.system() == "Linux":
# Assuming no one is running this test with a version of glibc released in
Expand Down

0 comments on commit 3116ef0

Please sign in to comment.