summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-05-15 16:40:32 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-05-15 16:40:32 +0200
commitb543b3fddbcd9a1c931783e3f2230871a3e7ac9e (patch)
tree418b87bf9568b72aa60c94e2100c1f75f43a109e
parent34d1006eb52b134e2f135430c1f25533ce62a00e (diff)
downloadpsutil-b543b3fddbcd9a1c931783e3f2230871a3e7ac9e.tar.gz
shorter testfn
-rw-r--r--psutil/tests/__init__.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 350f9f38..61115d40 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -815,10 +815,8 @@ def get_testfn(suffix="", dir=None):
deletion at interpreter exit. It's technically racy but probably
not really due to the time variant.
"""
- timer = getattr(time, 'perf_counter', time.time)
while True:
- prefix = "%s%.9f-" % (TESTFN_PREFIX, timer())
- name = tempfile.mktemp(prefix=prefix, suffix=suffix, dir=dir)
+ name = tempfile.mktemp(prefix=TESTFN_PREFIX, suffix=suffix, dir=dir)
if not os.path.exists(name): # also include dirs
return os.path.realpath(name) # needed for OSX