[pygobject/py3.8-fixes: 2/5] tests: remove usage of time.clock(), no longer available in py3.8



commit e8402ed0d819f8640b2fefe066187f7b60e76649
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Jun 7 16:28:54 2019 +0200

    tests: remove usage of time.clock(), no longer available in py3.8

 tests/test_overrides_gtk.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 627d5760..d96d8fe8 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -6,10 +6,10 @@ from __future__ import absolute_import
 
 import contextlib
 import unittest
-import time
 import sys
 import gc
 import warnings
+import timeit
 
 import pytest
 
@@ -2260,12 +2260,12 @@ class TestTreeModel(unittest.TestCase):
         model = Gtk.ListStore(int, str)
 
         iterations = 2000
-        start = time.clock()
+        start = timeit.default_timer()
         i = iterations
         while i > 0:
             model.append([1, 'hello'])
             i -= 1
-        end = time.clock()
+        end = timeit.default_timer()
         sys.stderr.write('[%.0f µs/append] ' % ((end - start) * 1000000 / iterations))
 
     def test_filter_new_default(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]