Skip to content

Commit

Permalink
Fix as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi Hakim committed Apr 2, 2015
1 parent 05e4212 commit f518f21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 3 additions & 5 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@ def __init__(self, *args, **kwargs):

self.check = None

def reset(self):
self.check = None

def is_travis(self):
return "TRAVIS" in os.environ

# Helper function when testing rates
def run_check_twice(self, config, agent_config=None, mocks=None):
self.run_check(config, agent_config, mocks)
def run_check_twice(self, config, agent_config=None, mocks=None,
force_reload=False):
self.run_check(config, agent_config, mocks, force_reload)
time.sleep(1)
self.run_check(config, agent_config, mocks)

Expand Down
7 changes: 1 addition & 6 deletions tests/test_mcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def testCoverage(self):

self.coverage_report()

self.reset()
config = {
'init_config': {},
'instances': [
Expand All @@ -108,7 +107,7 @@ def testCoverage(self):
]
}

self.run_check_twice(config)
self.run_check_twice(config, force_reload=True)
for tags in tag_set:
for m in GAUGES:
self.assertMetric("memcache.{0}".format(m), tags=tags, count=1)
Expand All @@ -117,7 +116,6 @@ def testCoverage(self):
"memcache.{0}_rate".format(m), tags=tags, count=1)

good_service_check_tags = ["host:localhost", "port:{0}".format(PORT)]
bad_service_check_tags = ["host:unix", "port:foo/bar"]

self.assertServiceCheck(
SERVICE_CHECK, status=AgentCheck.OK,
Expand Down Expand Up @@ -172,6 +170,3 @@ def testMemoryLeak(self):
self.assertEquals(end - start, 0, gc.garbage)
finally:
gc.set_debug(0)

if __name__ == '__main__':
unittest.main()

0 comments on commit f518f21

Please sign in to comment.