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
a2d46537
Kaydet (Commit)
a2d46537
authored
Ock 30, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7092: silence py3k warnings for deprecated modules
üst
75d3fb1e
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
47 additions
and
30 deletions
+47
-30
test_anydbm.py
Lib/test/test_anydbm.py
+3
-1
test_bsddb.py
Lib/test/test_bsddb.py
+3
-2
test_commands.py
Lib/test/test_commands.py
+4
-1
test_hotshot.py
Lib/test/test_hotshot.py
+2
-2
test_linuxaudiodev.py
Lib/test/test_linuxaudiodev.py
+3
-2
test_mailbox.py
Lib/test/test_mailbox.py
+2
-1
test_multifile.py
Lib/test/test_multifile.py
+1
-1
test_pyclbr.py
Lib/test/test_pyclbr.py
+12
-8
test_shelve.py
Lib/test/test_shelve.py
+2
-0
test_transformer.py
Lib/test/test_transformer.py
+3
-0
test_urllib2_localnet.py
Lib/test/test_urllib2_localnet.py
+3
-3
test_urllibnet.py
Lib/test/test_urllibnet.py
+1
-1
test_whichdb.py
Lib/test/test_whichdb.py
+6
-3
test_xmllib.py
Lib/test/test_xmllib.py
+2
-5
No files found.
Lib/test/test_anydbm.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -5,12 +5,14 @@
import
os
import
unittest
import
anydbm
import
glob
from
test
import
test_support
_fname
=
test_support
.
TESTFN
# Silence Py3k warning
anydbm
=
test_support
.
import_module
(
'anydbm'
,
deprecated
=
True
)
def
_delete_files
():
# we don't know the precise name the underlying database uses
# so we use glob to locate all names
...
...
Lib/test/test_bsddb.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -10,8 +10,9 @@ from test import test_support
# Skip test if _bsddb wasn't built.
test_support
.
import_module
(
'_bsddb'
)
import
bsddb
import
dbhash
# Just so we know it's imported
bsddb
=
test_support
.
import_module
(
'bsddb'
,
deprecated
=
True
)
# Just so we know it's imported:
test_support
.
import_module
(
'dbhash'
,
deprecated
=
True
)
class
TestBSDDB
(
unittest
.
TestCase
):
...
...
Lib/test/test_commands.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -9,7 +9,10 @@ import warnings
warnings
.
filterwarnings
(
'ignore'
,
r".*commands.getstatus.. is deprecated"
,
DeprecationWarning
)
from
test.test_support
import
run_unittest
,
reap_children
from
test.test_support
import
run_unittest
,
reap_children
,
import_module
# Silence Py3k warning
import_module
(
'commands'
,
deprecated
=
True
)
from
commands
import
*
# The module says:
...
...
Lib/test/test_hotshot.py
Dosyayı görüntüle @
a2d46537
import
hotshot
import
hotshot.log
import
os
import
pprint
import
unittest
...
...
@@ -9,6 +7,8 @@ import gc
from
test
import
test_support
# Silence Py3k warning
hotshot
=
test_support
.
import_module
(
'hotshot'
,
deprecated
=
True
)
from
hotshot.log
import
ENTER
,
EXIT
,
LINE
...
...
Lib/test/test_linuxaudiodev.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -4,12 +4,13 @@ test_support.requires('audio')
from
test.test_support
import
findfile
,
run_unittest
import
errno
linuxaudiodev
=
test_support
.
import_module
(
'linuxaudiodev'
,
deprecated
=
True
)
import
sys
import
sunaudio
import
audioop
import
unittest
linuxaudiodev
=
test_support
.
import_module
(
'linuxaudiodev'
,
deprecated
=
True
)
sunaudio
=
test_support
.
import_module
(
'sunaudio'
,
deprecated
=
True
)
SND_FORMAT_MULAW_8
=
1
class
LinuxAudioDevTests
(
unittest
.
TestCase
):
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -5,7 +5,6 @@ import stat
import
socket
import
email
import
email.message
import
rfc822
import
re
import
StringIO
from
test
import
test_support
...
...
@@ -17,6 +16,8 @@ try:
except
ImportError
:
pass
# Silence Py3k warning
rfc822
=
test_support
.
import_module
(
'rfc822'
,
deprecated
=
True
)
class
TestBase
(
unittest
.
TestCase
):
...
...
Lib/test/test_multifile.py
Dosyayı görüntüle @
a2d46537
from
test
import
test_support
import
mimetools
mimetools
=
test_support
.
import_module
(
'mimetools'
,
deprecated
=
True
)
multifile
=
test_support
.
import_module
(
'multifile'
,
deprecated
=
True
)
import
cStringIO
...
...
Lib/test/test_pyclbr.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -2,7 +2,7 @@
Test cases for pyclbr.py
Nick Mathewson
'''
from
test.test_support
import
run_unittest
from
test.test_support
import
run_unittest
,
import_module
import
sys
from
types
import
ClassType
,
FunctionType
,
MethodType
,
BuiltinFunctionType
import
pyclbr
...
...
@@ -11,8 +11,10 @@ from unittest import TestCase
StaticMethodType
=
type
(
staticmethod
(
lambda
:
None
))
ClassMethodType
=
type
(
classmethod
(
lambda
c
:
None
))
# This next line triggers an error on old versions of pyclbr.
# Silence Py3k warning
import_module
(
'commands'
,
deprecated
=
True
)
# This next line triggers an error on old versions of pyclbr.
from
commands
import
getstatus
# Here we test the python class browser code.
...
...
@@ -40,16 +42,16 @@ class PyclbrTest(TestCase):
def
assertHaskey
(
self
,
obj
,
key
,
ignore
):
''' succeed iff
obj.has_key(key)
or key in ignore. '''
''' succeed iff
key in obj
or key in ignore. '''
if
key
in
ignore
:
return
if
not
obj
.
has_key
(
key
)
:
print
>>
sys
.
stderr
,
"***"
,
key
self
.
assert
True
(
obj
.
has_key
(
key
)
)
if
key
not
in
obj
:
print
>>
sys
.
stderr
,
"***"
,
key
self
.
assert
In
(
key
,
obj
)
def
assertEqualsOrIgnored
(
self
,
a
,
b
,
ignore
):
''' succeed iff a == b or a in ignore or b in ignore '''
if
a
not
in
ignore
and
b
not
in
ignore
:
self
.
assertEqual
s
(
a
,
b
)
self
.
assertEqual
(
a
,
b
)
def
checkModule
(
self
,
moduleName
,
module
=
None
,
ignore
=
()):
''' succeed iff pyclbr.readmodule_ex(modulename) corresponds
...
...
@@ -149,7 +151,9 @@ class PyclbrTest(TestCase):
def
test_easy
(
self
):
self
.
checkModule
(
'pyclbr'
)
self
.
checkModule
(
'doctest'
,
ignore
=
(
"DocTestCase"
,))
self
.
checkModule
(
'rfc822'
)
# Silence Py3k warning
rfc822
=
import_module
(
'rfc822'
,
deprecated
=
True
)
self
.
checkModule
(
'rfc822'
,
rfc822
)
self
.
checkModule
(
'difflib'
)
def
test_decorators
(
self
):
...
...
Lib/test/test_shelve.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -4,6 +4,8 @@ import shelve
import
glob
from
test
import
test_support
test_support
.
import_module
(
'anydbm'
,
deprecated
=
True
)
class
TestCase
(
unittest
.
TestCase
):
fn
=
"shelftemp"
+
os
.
extsep
+
"db"
...
...
Lib/test/test_transformer.py
Dosyayı görüntüle @
a2d46537
import
unittest
from
test
import
test_support
# Silence Py3k warning
test_support
.
import_module
(
'compiler'
,
deprecated
=
True
)
from
compiler
import
transformer
,
ast
from
compiler
import
compile
...
...
Lib/test/test_urllib2_localnet.py
Dosyayı görüntüle @
a2d46537
#!/usr/bin/env python
import
mimetools
import
threading
import
urlparse
import
urllib2
...
...
@@ -8,6 +7,7 @@ import BaseHTTPServer
import
unittest
import
hashlib
from
test
import
test_support
mimetools
=
test_support
.
import_module
(
'mimetools'
,
deprecated
=
True
)
# Loopback http server infrastructure
...
...
@@ -154,13 +154,13 @@ class DigestAuthHandler:
if
len
(
self
.
_users
)
==
0
:
return
True
if
not
request_handler
.
headers
.
has_key
(
'Proxy-Authorization'
)
:
if
'Proxy-Authorization'
not
in
request_handler
.
headers
:
return
self
.
_return_auth_challenge
(
request_handler
)
else
:
auth_dict
=
self
.
_create_auth_dict
(
request_handler
.
headers
[
'Proxy-Authorization'
]
)
if
self
.
_users
.
has_key
(
auth_dict
[
"username"
])
:
if
auth_dict
[
"username"
]
in
self
.
_users
:
password
=
self
.
_users
[
auth_dict
[
"username"
]
]
else
:
return
self
.
_return_auth_challenge
(
request_handler
)
...
...
Lib/test/test_urllibnet.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -7,7 +7,7 @@ import socket
import
urllib
import
sys
import
os
import
mimetools
mimetools
=
test_support
.
import_module
(
"mimetools"
,
deprecated
=
True
)
def
_open_with_retry
(
func
,
host
,
*
args
,
**
kwargs
):
...
...
Lib/test/test_whichdb.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -7,11 +7,13 @@ import os
import
test.test_support
import
unittest
import
whichdb
import
anydbm
import
glob
_fname
=
test
.
test_support
.
TESTFN
# Silence Py3k warning
anydbm
=
test
.
test_support
.
import_module
(
'anydbm'
,
deprecated
=
True
)
def
_delete_files
():
# we don't know the precise name the underlying database uses
# so we use glob to locate all names
...
...
@@ -37,8 +39,9 @@ for name in anydbm._names:
# we define a new test method for each
# candidate database module.
try
:
mod
=
__import__
(
name
)
except
ImportError
:
# Silence Py3k warning
mod
=
test
.
test_support
.
import_module
(
name
,
deprecated
=
True
)
except
unittest
.
SkipTest
:
continue
def
test_whichdb_name
(
self
,
name
=
name
,
mod
=
mod
):
...
...
Lib/test/test_xmllib.py
Dosyayı görüntüle @
a2d46537
...
...
@@ -15,13 +15,10 @@ testdoc = """\
nsdoc
=
"<foo xmlns='URI' attr='val'/>"
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
".* xmllib .* obsolete.*"
,
DeprecationWarning
,
r'xmllib$'
)
from
test
import
test_support
import
unittest
import
xmllib
# Silence Py3k warning
xmllib
=
test_support
.
import_module
(
'xmllib'
,
deprecated
=
True
)
class
XMLParserTestCase
(
unittest
.
TestCase
):
...
...
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