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
a210a146
Commit
a210a146
authored
May 31, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18094: test_uuid no more reports skipped tests as passed.
parent
007a5d76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
51 deletions
+29
-51
Lib/test/test_uuid.py
Lib/test/test_uuid.py
+27
-51
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_uuid.py
View file @
a210a146
from
unittest
import
TestCase
import
unittest
from
test
import
support
import
builtins
import
builtins
import
os
import
uuid
import
uuid
def
importable
(
name
):
def
importable
(
name
):
...
@@ -10,7 +10,7 @@ def importable(name):
...
@@ -10,7 +10,7 @@ def importable(name):
except
:
except
:
return
False
return
False
class
TestUUID
(
TestCase
):
class
TestUUID
(
unittest
.
TestCase
):
last_node
=
None
last_node
=
None
source2node
=
{}
source2node
=
{}
...
@@ -310,24 +310,22 @@ class TestUUID(TestCase):
...
@@ -310,24 +310,22 @@ class TestUUID(TestCase):
else
:
else
:
TestUUID
.
last_node
=
node
TestUUID
.
last_node
=
node
@
unittest
.
skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_ifconfig_getnode
(
self
):
def
test_ifconfig_getnode
(
self
):
import
sys
node
=
uuid
.
_ifconfig_getnode
()
import
os
if
node
is
not
None
:
if
os
.
name
==
'posix'
:
self
.
check_node
(
node
,
'ifconfig'
)
node
=
uuid
.
_ifconfig_getnode
()
if
node
is
not
None
:
self
.
check_node
(
node
,
'ifconfig'
)
@
unittest
.
skipUnless
(
os
.
name
==
'nt'
,
'requires Windows'
)
def
test_ipconfig_getnode
(
self
):
def
test_ipconfig_getnode
(
self
):
import
os
node
=
uuid
.
_ipconfig_getnode
()
if
os
.
name
==
'nt'
:
if
node
is
not
None
:
node
=
uuid
.
_ipconfig_getnode
()
self
.
check_node
(
node
,
'ipconfig'
)
if
node
is
not
None
:
self
.
check_node
(
node
,
'ipconfig'
)
@
unittest
.
skipUnless
(
importable
(
'win32wnet'
),
'requires win32wnet'
)
@
unittest
.
skipUnless
(
importable
(
'netbios'
),
'requires netbios'
)
def
test_netbios_getnode
(
self
):
def
test_netbios_getnode
(
self
):
if
importable
(
'win32wnet'
)
and
importable
(
'netbios'
):
self
.
check_node
(
uuid
.
_netbios_getnode
(),
'netbios'
)
self
.
check_node
(
uuid
.
_netbios_getnode
(),
'netbios'
)
def
test_random_getnode
(
self
):
def
test_random_getnode
(
self
):
node
=
uuid
.
_random_getnode
()
node
=
uuid
.
_random_getnode
()
...
@@ -335,22 +333,20 @@ class TestUUID(TestCase):
...
@@ -335,22 +333,20 @@ class TestUUID(TestCase):
self
.
assertTrue
(
node
&
0x010000000000
)
self
.
assertTrue
(
node
&
0x010000000000
)
self
.
assertTrue
(
node
<
(
1
<<
48
))
self
.
assertTrue
(
node
<
(
1
<<
48
))
@
unittest
.
skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@
unittest
.
skipUnless
(
importable
(
'ctypes'
),
'requires ctypes'
)
def
test_unixdll_getnode
(
self
):
def
test_unixdll_getnode
(
self
):
import
sys
try
:
# Issues 1481, 3581: _uuid_generate_time() might be None.
import
os
self
.
check_node
(
uuid
.
_unixdll_getnode
(),
'unixdll'
)
if
importable
(
'ctypes'
)
and
os
.
name
==
'posix'
:
except
TypeError
:
try
:
# Issues 1481, 3581: _uuid_generate_time() might be None.
pass
self
.
check_node
(
uuid
.
_unixdll_getnode
(),
'unixdll'
)
except
TypeError
:
pass
@
unittest
.
skipUnless
(
os
.
name
==
'nt'
,
'requires Windows'
)
@
unittest
.
skipUnless
(
importable
(
'ctypes'
),
'requires ctypes'
)
def
test_windll_getnode
(
self
):
def
test_windll_getnode
(
self
):
import
os
self
.
check_node
(
uuid
.
_windll_getnode
(),
'windll'
)
if
importable
(
'ctypes'
)
and
os
.
name
==
'nt'
:
self
.
check_node
(
uuid
.
_windll_getnode
(),
'windll'
)
def
test_getnode
(
self
):
def
test_getnode
(
self
):
import
sys
node1
=
uuid
.
getnode
()
node1
=
uuid
.
getnode
()
self
.
check_node
(
node1
,
"getnode1"
)
self
.
check_node
(
node1
,
"getnode1"
)
...
@@ -360,13 +356,8 @@ class TestUUID(TestCase):
...
@@ -360,13 +356,8 @@ class TestUUID(TestCase):
self
.
assertEqual
(
node1
,
node2
)
self
.
assertEqual
(
node1
,
node2
)
@
unittest
.
skipUnless
(
importable
(
'ctypes'
),
'requires ctypes'
)
def
test_uuid1
(
self
):
def
test_uuid1
(
self
):
# uuid1 requires ctypes.
try
:
import
ctypes
except
ImportError
:
return
equal
=
self
.
assertEqual
equal
=
self
.
assertEqual
# Make sure uuid1() generates UUIDs that are actually version 1.
# Make sure uuid1() generates UUIDs that are actually version 1.
...
@@ -419,13 +410,8 @@ class TestUUID(TestCase):
...
@@ -419,13 +410,8 @@ class TestUUID(TestCase):
equal
(
u
,
uuid
.
UUID
(
v
))
equal
(
u
,
uuid
.
UUID
(
v
))
equal
(
str
(
u
),
v
)
equal
(
str
(
u
),
v
)
@
unittest
.
skipUnless
(
importable
(
'ctypes'
),
'requires ctypes'
)
def
test_uuid4
(
self
):
def
test_uuid4
(
self
):
# uuid4 requires ctypes.
try
:
import
ctypes
except
ImportError
:
return
equal
=
self
.
assertEqual
equal
=
self
.
assertEqual
# Make sure uuid4() generates UUIDs that are actually version 4.
# Make sure uuid4() generates UUIDs that are actually version 4.
...
@@ -457,12 +443,8 @@ class TestUUID(TestCase):
...
@@ -457,12 +443,8 @@ class TestUUID(TestCase):
equal
(
u
,
uuid
.
UUID
(
v
))
equal
(
u
,
uuid
.
UUID
(
v
))
equal
(
str
(
u
),
v
)
equal
(
str
(
u
),
v
)
@
unittest
.
skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
testIssue8621
(
self
):
def
testIssue8621
(
self
):
import
os
import
sys
if
os
.
name
!=
'posix'
:
return
# On at least some versions of OSX uuid.uuid4 generates
# On at least some versions of OSX uuid.uuid4 generates
# the same sequence of UUIDs in the parent and any
# the same sequence of UUIDs in the parent and any
# children started using fork.
# children started using fork.
...
@@ -483,11 +465,5 @@ class TestUUID(TestCase):
...
@@ -483,11 +465,5 @@ class TestUUID(TestCase):
self
.
assertNotEqual
(
parent_value
,
child_value
)
self
.
assertNotEqual
(
parent_value
,
child_value
)
def
test_main
():
support
.
run_unittest
(
TestUUID
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
Misc/NEWS
View file @
a210a146
...
@@ -78,6 +78,8 @@ IDLE
...
@@ -78,6 +78,8 @@ IDLE
Tests
Tests
-----
-----
-
Issue
#
18094
:
test_uuid
no
more
reports
skipped
tests
as
passed
.
-
Issue
#
11995
:
test_pydoc
doesn
't import all sys.path modules anymore.
-
Issue
#
11995
:
test_pydoc
doesn
't import all sys.path modules anymore.
Documentation
Documentation
...
...
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