Skip to content

Commit

Permalink
responds to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmeyer committed Aug 22, 2018
1 parent a6e85a1 commit e2093e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion go_expvar/datadog_checks/go_expvar/go_expvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def _load(self, instance):
url = parsed_url._replace(path=GO_EXPVAR_URL_PATH).geturl()

tags = instance.get('tags', [])
self.log.warning(tags)
expvar_url_tag = "expvar_url:%s" % url
if expvar_url_tag not in tags:
tags.append(expvar_url_tag)
Expand Down
8 changes: 3 additions & 5 deletions go_expvar/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ def go_expvar_mock():
with open(filepath, 'r') as f:
data = f.read()
json_data = json.loads(data)
p = mock.patch('datadog_checks.go_expvar.GoExpvar._get_data', return_value=json_data)
yield p.start()
p.stop()
with mock.patch('datadog_checks.go_expvar.GoExpvar._get_data', return_value=json_data):
yield


@pytest.fixture(scope="session")
Expand All @@ -38,9 +37,8 @@ def spin_up_go_expvar():
os.path.join(common.HERE, 'compose', 'docker-compose.yaml'),
endpoints=[common.URL]
):
for _ in range(0, 9):
for _ in range(9):
requests.get(common.URL + "?user=123456")

yield


Expand Down
1 change: 0 additions & 1 deletion go_expvar/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def test_max_metrics(go_expvar_mock, check, aggregator):

# Default metrics
for gauge in CHECK_GAUGES_DEFAULT:
log.warning(aggregator.metrics(gauge.format(common.CHECK_NAME)))
aggregator.assert_metric(gauge.format(common.CHECK_NAME),
count=2, tags=shared_tags)

Expand Down
13 changes: 5 additions & 8 deletions go_expvar/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,21 @@ envlist =

[testenv]
platform = darwin|linux|win32
deps =
../datadog_checks_base[deps]
-r../datadog_checks_base/requirements.in
-rrequirements-dev.txt
passenv =
DOCKER*
COMPOSE*

[testenv:go_expvar]
deps =
../datadog_checks_base
-r../datadog_checks_base/requirements.in
-rrequirements-dev.txt

commands =
pip install --require-hashes -r requirements.txt
pytest -v -m"integration"

[testenv:unit]
deps =
../datadog_checks_base
-r../datadog_checks_base/requirements.in
-rrequirements-dev.txt
commands =
pip install --require-hashes -r requirements.txt
pytest -v -m"not integration"
Expand Down

0 comments on commit e2093e4

Please sign in to comment.