summaryrefslogtreecommitdiffstats
path: root/unitest.py
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2018-04-02 14:18:19 +0200
committernicolargo <nicolas@nicolargo.com>2018-04-02 14:18:19 +0200
commit982054becd85e443b0f6e69e1157f9299fabcd83 (patch)
treec6c449e8ec092617a73008dd789b3c74a47ca410 /unitest.py
parent376ce7a8e9e447848b050029e402d10dbbd5bf01 (diff)
Correct an subsampling issue on Python 3
Diffstat (limited to 'unitest.py')
-rwxr-xr-xunitest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/unitest.py b/unitest.py
index 20df9eda..a36b3a2e 100755
--- a/unitest.py
+++ b/unitest.py
@@ -34,7 +34,7 @@ from glances.thresholds import GlancesThresholdWarning
from glances.thresholds import GlancesThresholdCritical
from glances.thresholds import GlancesThresholds
from glances.plugins.glances_plugin import GlancesPlugin
-from glances.compat import subsample
+from glances.compat import subsample, range
# Global variables
# =================
@@ -249,8 +249,8 @@ class TestGlances(unittest.TestCase):
([1, 2, 3, 4], 4),
([1, 2, 3, 4, 5, 6, 7], 4),
([1, 2, 3, 4, 5, 6, 7, 8], 4),
- (list(xrange(1, 800)), 4),
- (list(xrange(1, 8000)), 800)]:
+ (list(range(1, 800)), 4),
+ (list(range(1, 8000)), 800)]:
l_subsample = subsample(l[0], l[1])
self.assertLessEqual(len(l_subsample), l[1])