Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
123ca5bd
Commit
123ca5bd
authored
Aug 05, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some test cleanups
parent
c684b0f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
fs/tests/__init__.py
+7
-1
No files found.
fs/tests/__init__.py
View file @
123ca5bd
...
...
@@ -495,6 +495,10 @@ class FSTestCases:
class
ThreadingTestCases
:
"""Testcases for thread-safety of FS implementations."""
# These are either too slow to be worth repeating,
# or cannot possibly break cross-thread.
_dont_retest
=
(
"test_pickling"
,
"test_multiple_overwrite"
,)
__lock
=
threading
.
RLock
()
def
_yield
(
self
):
...
...
@@ -581,7 +585,7 @@ class ThreadingTestCases:
for
meth
in
dir
(
this
):
if
not
meth
.
startswith
(
"test_"
):
continue
if
meth
in
(
"test_pickling"
,)
:
if
meth
in
self
.
_dont_retest
:
continue
if
not
hasattr
(
FSTestCases
,
meth
):
continue
...
...
@@ -678,11 +682,13 @@ class ThreadingTestCases:
for
i
in
xrange
(
30
):
for
c
in
contents
:
self
.
fs
.
setcontents
(
"thread1.txt"
,
c
)
self
.
assertEquals
(
self
.
fs
.
getsize
(
"thread1.txt"
),
len
(
c
))
self
.
assertEquals
(
self
.
fs
.
getcontents
(
"thread1.txt"
),
c
)
def
thread2
():
for
i
in
xrange
(
30
):
for
c
in
contents
:
self
.
fs
.
setcontents
(
"thread2.txt"
,
c
)
self
.
assertEquals
(
self
.
fs
.
getsize
(
"thread2.txt"
),
len
(
c
))
self
.
assertEquals
(
self
.
fs
.
getcontents
(
"thread2.txt"
),
c
)
self
.
_runThreads
(
thread1
,
thread2
)
...
...
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