Skip to content

Commit b72da86

Browse files
committed
Fix python 2.6 skipIf
Signed-off-by: Krukov Dima <glebov.ru@gmail.com>
1 parent 455b035 commit b72da86

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

prometheus_client/gc_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _get_bounds(gen, bucket_name):
8989
if bucket_name == GC_COLLECTOR._LATENCY:
9090
return Histogram.DEFAULT_BUCKETS
9191
_max = gc.get_threshold()[gen]
92-
return [int(_max/100), int(_max/50), int(_max/10), int(_max/5), int(_max/2), _max]
92+
return [int(_max / 100), int(_max / 50), int(_max / 10), int(_max / 5), int(_max / 2), _max]
9393

9494
def collect(self):
9595
collected = HistogramMetricFamily(

tests/test_gc_collector.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import gc
44
import sys
5-
import unittest
5+
6+
if sys.version_info < (2, 7):
7+
# We need the skip decorators from unittest2 on Python 2.6.
8+
import unittest2 as unittest
9+
else:
10+
import unittest
611

712
from prometheus_client import CollectorRegistry, GCCollector
813

0 commit comments

Comments
 (0)