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
34cd2ae6
Kaydet (Commit)
34cd2ae6
authored
Ock 22, 2015
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Break up TestCommandLine.test_env_var into four distinct tests.
üst
7ffa2c5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
test_tracemalloc.py
Lib/test/test_tracemalloc.py
+5
-3
No files found.
Lib/test/test_tracemalloc.py
Dosyayı görüntüle @
34cd2ae6
...
...
@@ -748,26 +748,28 @@ class TestFilters(unittest.TestCase):
class
TestCommandLine
(
unittest
.
TestCase
):
def
test_env_var
(
self
):
def
test_env_var
_disabled_by_default
(
self
):
# not tracing by default
code
=
'import tracemalloc; print(tracemalloc.is_tracing())'
ok
,
stdout
,
stderr
=
assert_python_ok
(
'-c'
,
code
)
stdout
=
stdout
.
rstrip
()
self
.
assertEqual
(
stdout
,
b
'False'
)
# PYTHON* environment variables must be ignored when -E option is
# present
def
test_env_var_ignored_with_E
(
self
):
"""PYTHON* environment variables must be ignored when -E is present."""
code
=
'import tracemalloc; print(tracemalloc.is_tracing())'
ok
,
stdout
,
stderr
=
assert_python_ok
(
'-E'
,
'-c'
,
code
,
PYTHONTRACEMALLOC
=
'1'
)
stdout
=
stdout
.
rstrip
()
self
.
assertEqual
(
stdout
,
b
'False'
)
def
test_env_var_enabled_at_startup
(
self
):
# tracing at startup
code
=
'import tracemalloc; print(tracemalloc.is_tracing())'
ok
,
stdout
,
stderr
=
assert_python_ok
(
'-c'
,
code
,
PYTHONTRACEMALLOC
=
'1'
)
stdout
=
stdout
.
rstrip
()
self
.
assertEqual
(
stdout
,
b
'True'
)
def
test_env_limit
(
self
):
# start and set the number of frames
code
=
'import tracemalloc; print(tracemalloc.get_traceback_limit())'
ok
,
stdout
,
stderr
=
assert_python_ok
(
'-c'
,
code
,
PYTHONTRACEMALLOC
=
'10'
)
...
...
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