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
13775940
Commit
13775940
authored
Jul 21, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On WIndows, skip the part of test_dircache that can't work on Windows.
parent
87cc0c32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
Lib/test/test_dircache.py
Lib/test/test_dircache.py
+15
-9
No files found.
Lib/test/test_dircache.py
View file @
13775940
...
...
@@ -5,7 +5,7 @@
import
unittest
from
test_support
import
run_unittest
,
TESTFN
import
dircache
,
os
,
time
import
dircache
,
os
,
time
,
sys
class
DircacheTests
(
unittest
.
TestCase
):
...
...
@@ -40,14 +40,20 @@ class DircacheTests(unittest.TestCase):
# Check that cache is actually caching, not just passing through.
self
.
assert_
(
dircache
.
listdir
(
self
.
tempdir
)
is
entries
)
# Sadly, dircache has the same granularity as stat.mtime, and so
# can't notice any changes that occured within 1 sec of the last
# time it examined a directory.
time
.
sleep
(
1
)
self
.
writeTemp
(
"test1"
)
entries
=
dircache
.
listdir
(
self
.
tempdir
)
self
.
assertEquals
(
entries
,
[
'test1'
])
self
.
assert_
(
dircache
.
listdir
(
self
.
tempdir
)
is
entries
)
# Directories aren't "files" on Windows, and directory mtime has
# nothing to do with when files under a directory get created.
# That is, this test can't possibly work under Windows -- dircache
# is only good for capturing a one-shot snapshot there.
if
sys
.
platform
[:
3
]
not
in
(
'win'
,
'os2'
):
# Sadly, dircache has the same granularity as stat.mtime, and so
# can't notice any changes that occured within 1 sec of the last
# time it examined a directory.
time
.
sleep
(
1
)
self
.
writeTemp
(
"test1"
)
entries
=
dircache
.
listdir
(
self
.
tempdir
)
self
.
assertEquals
(
entries
,
[
'test1'
])
self
.
assert_
(
dircache
.
listdir
(
self
.
tempdir
)
is
entries
)
## UNSUCCESSFUL CASES
self
.
assertEquals
(
dircache
.
listdir
(
self
.
tempdir
+
"_nonexistent"
),
[])
...
...
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