Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
32a148e7
Commit
32a148e7
authored
Nov 01, 2007
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed non ASCII text from test as requested by Guido. Sorry :/
parent
35795d2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
20 deletions
+2
-20
Lib/test/test_import.py
Lib/test/test_import.py
+2
-20
No files found.
Lib/test/test_import.py
View file @
32a148e7
...
@@ -223,8 +223,7 @@ class ImportTest(unittest.TestCase):
...
@@ -223,8 +223,7 @@ class ImportTest(unittest.TestCase):
warnings
.
simplefilter
(
'error'
,
ImportWarning
)
warnings
.
simplefilter
(
'error'
,
ImportWarning
)
self
.
assertRaises
(
ImportWarning
,
__import__
,
"site-packages"
)
self
.
assertRaises
(
ImportWarning
,
__import__
,
"site-packages"
)
class
UnicodePathsTests
(
unittest
.
TestCase
):
class
PathsTests
(
unittest
.
TestCase
):
SAMPLES
=
(
'test'
,
'testäöüß'
,
'testéè'
,
'test°³²'
)
path
=
TESTFN
path
=
TESTFN
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -235,23 +234,6 @@ class UnicodePathsTests(unittest.TestCase):
...
@@ -235,23 +234,6 @@ class UnicodePathsTests(unittest.TestCase):
shutil
.
rmtree
(
self
.
path
)
shutil
.
rmtree
(
self
.
path
)
sys
.
path
=
self
.
syspath
sys
.
path
=
self
.
syspath
def
test_sys_path
(
self
):
for
i
,
subpath
in
enumerate
(
self
.
SAMPLES
):
path
=
os
.
path
.
join
(
self
.
path
,
subpath
)
os
.
mkdir
(
path
)
self
.
failUnless
(
os
.
path
.
exists
(
path
),
os
.
listdir
(
self
.
path
))
f
=
open
(
os
.
path
.
join
(
path
,
'testimport%i.py'
%
i
),
'w'
)
f
.
write
(
"testdata = 'unicode path %i'
\
n
"
%
i
)
f
.
close
()
sys
.
path
.
append
(
path
)
try
:
mod
=
__import__
(
"testimport%i"
%
i
)
except
ImportError
:
print
>>
sys
.
stderr
,
path
raise
self
.
assertEqual
(
mod
.
testdata
,
'unicode path %i'
%
i
)
unload
(
"testimport%i"
%
i
)
# http://bugs.python.org/issue1293
# http://bugs.python.org/issue1293
def
test_trailing_slash
(
self
):
def
test_trailing_slash
(
self
):
f
=
open
(
os
.
path
.
join
(
self
.
path
,
'test_trailing_slash.py'
),
'w'
)
f
=
open
(
os
.
path
.
join
(
self
.
path
,
'test_trailing_slash.py'
),
'w'
)
...
@@ -263,7 +245,7 @@ class UnicodePathsTests(unittest.TestCase):
...
@@ -263,7 +245,7 @@ class UnicodePathsTests(unittest.TestCase):
unload
(
"test_trailing_slash"
)
unload
(
"test_trailing_slash"
)
def
test_main
(
verbose
=
None
):
def
test_main
(
verbose
=
None
):
run_unittest
(
ImportTest
,
Unicode
PathsTests
)
run_unittest
(
ImportTest
,
PathsTests
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_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