Skip to content

Commit

Permalink
Re-repair tests for 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Dec 14, 2023
1 parent 976cae8 commit b71120e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 9 additions & 2 deletions cmdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ def function():
"""

try:
perf_counter = time_.perf_counter

# Python 2.7
except AttributeError:
perf_counter = time_.clock

def timings_decorator(func):
if not TIMINGS:
# Do not wrap the function.
Expand All @@ -188,12 +195,12 @@ def timings_decorator(func):

@wraps(func)
def func_wrapper(*args, **kwargs):
t0 = time_.perf_counter()
t0 = perf_counter()

try:
return func(*args, **kwargs)
finally:
t1 = time_.perf_counter()
t1 = perf_counter()
duration = (t1 - t0) * 10 ** 6 # microseconds

Stats.LastTiming = duration
Expand Down
6 changes: 2 additions & 4 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import flaky.flaky_nose_plugin as flaky

# For nose
if sys.version_info[0] == 3:
import collections
import collections
if not hasattr(collections, "Callable"):
collections.Callable = collections.abc.Callable


Expand All @@ -34,8 +34,6 @@
"cmdx.py",
])

cmds.colorManagementPrefs(cmEnabled=False, edit=True)

result = nose.main(
argv=argv,
addplugins=[flaky.FlakyPlugin()],
Expand Down

0 comments on commit b71120e

Please sign in to comment.