Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a88da67b
Kaydet (Commit)
a88da67b
authored
Mar 16, 2011
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11578: add unit tests for timeit module.
Patch by Michael Henry.
üst
07926f02
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
test_sundry.py
Lib/test/test_sundry.py
+0
-1
test_timeit.py
Lib/test/test_timeit.py
+0
-0
timeit.py
Lib/timeit.py
+8
-2
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_sundry.py
Dosyayı görüntüle @
a88da67b
...
...
@@ -54,7 +54,6 @@ class TestUntestedModules(unittest.TestCase):
import
py_compile
import
sndhdr
import
tabnanny
import
timeit
try
:
import
tty
# not available on Windows
except
ImportError
:
...
...
Lib/test/test_timeit.py
0 → 100644
Dosyayı görüntüle @
a88da67b
This diff is collapsed.
Click to expand it.
Lib/timeit.py
Dosyayı görüntüle @
a88da67b
...
...
@@ -232,10 +232,10 @@ def repeat(stmt="pass", setup="pass", timer=default_timer,
"""Convenience function to create Timer object and call repeat method."""
return
Timer
(
stmt
,
setup
,
timer
)
.
repeat
(
repeat
,
number
)
def
main
(
args
=
None
):
def
main
(
args
=
None
,
*
,
_wrap_timer
=
None
):
"""Main program, used when run as a script.
The optional argument specifies the command line to be parsed,
The optional
'args'
argument specifies the command line to be parsed,
defaulting to sys.argv[1:].
The return value is an exit code to be passed to sys.exit(); it
...
...
@@ -244,6 +244,10 @@ def main(args=None):
When an exception happens during timing, a traceback is printed to
stderr and the return value is 1. Exceptions at other times
(including the template compilation) are not caught.
'_wrap_timer' is an internal interface used for unit testing. If it
is not None, it must be a callable that accepts a timer function
and returns another timer function (used for unit testing).
"""
if
args
is
None
:
args
=
sys
.
argv
[
1
:]
...
...
@@ -289,6 +293,8 @@ def main(args=None):
# directory)
import
os
sys
.
path
.
insert
(
0
,
os
.
curdir
)
if
_wrap_timer
is
not
None
:
timer
=
_wrap_timer
(
timer
)
t
=
Timer
(
stmt
,
setup
,
timer
)
if
number
==
0
:
# determine number so that 0.2 <= total time < 2.0
...
...
Misc/NEWS
Dosyayı görüntüle @
a88da67b
...
...
@@ -126,6 +126,8 @@ Tools/Demos
Tests
-----
-
Issue
#
11578
:
added
test
for
the
timeit
module
.
Patch
Michael
Henry
.
-
Issue
#
11503
:
improve
test
coverage
of
posixpath
.
py
.
Patch
by
Evan
Dandrea
.
-
Issue
#
11505
:
improves
test
coverage
of
string
.
py
.
Patch
by
Alicia
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment