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
261a6d7c
Kaydet (Commit)
261a6d7c
authored
Kas 26, 2011
tarafından
Meador Inge
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #12618: create unit tests for the py_compile module
üst
4bc45b7a
6f16660c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
test_py_compile.py
Lib/test/test_py_compile.py
+42
-0
No files found.
Lib/test/test_py_compile.py
0 → 100644
Dosyayı görüntüle @
261a6d7c
import
imp
import
os
import
py_compile
import
shutil
import
tempfile
import
unittest
from
test
import
support
,
script_helper
class
PyCompileTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
directory
=
tempfile
.
mkdtemp
()
self
.
source_path
=
os
.
path
.
join
(
self
.
directory
,
'_test.py'
)
self
.
pyc_path
=
self
.
source_path
+
'c'
self
.
cache_path
=
imp
.
cache_from_source
(
self
.
source_path
)
with
open
(
self
.
source_path
,
'w'
)
as
file
:
file
.
write
(
'x = 123
\n
'
)
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
directory
)
def
test_absolute_path
(
self
):
py_compile
.
compile
(
self
.
source_path
,
self
.
pyc_path
)
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
pyc_path
))
self
.
assertFalse
(
os
.
path
.
exists
(
self
.
cache_path
))
def
test_cache_path
(
self
):
py_compile
.
compile
(
self
.
source_path
)
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
cache_path
))
def
test_relative_path
(
self
):
py_compile
.
compile
(
os
.
path
.
relpath
(
self
.
source_path
),
os
.
path
.
relpath
(
self
.
pyc_path
))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
pyc_path
))
self
.
assertFalse
(
os
.
path
.
exists
(
self
.
cache_path
))
def
test_main
():
support
.
run_unittest
(
PyCompileTests
)
if
__name__
==
"__main__"
:
test_main
()
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