Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
b4c4e818
Commit
b4c4e818
authored
Jun 12, 2015
by
Ben Patterson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8493 from edx/benp/allow-for-flaky-jun2015
Make addCleanup idempotent.
parents
8af8d257
04e764d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
common/test/acceptance/tests/helpers.py
+9
-1
common/test/acceptance/tests/lms/test_lms_course_discovery.py
+2
-1
common/test/acceptance/tests/lms/test_lms_courseware_search.py
+2
-2
No files found.
common/test/acceptance/tests/helpers.py
View file @
b4c4e818
...
@@ -96,6 +96,14 @@ def load_data_str(rel_path):
...
@@ -96,6 +96,14 @@ def load_data_str(rel_path):
return
data_file
.
read
()
return
data_file
.
read
()
def
remove_file
(
filename
):
"""
Remove a file if it exists
"""
if
os
.
path
.
exists
(
filename
):
os
.
remove
(
filename
)
def
disable_animations
(
page
):
def
disable_animations
(
page
):
"""
"""
Disable jQuery and CSS3 animations.
Disable jQuery and CSS3 animations.
...
@@ -675,4 +683,4 @@ class TestWithSearchIndexMixin(object):
...
@@ -675,4 +683,4 @@ class TestWithSearchIndexMixin(object):
def
_cleanup_index_file
(
self
):
def
_cleanup_index_file
(
self
):
""" Removes search index backing file """
""" Removes search index backing file """
os
.
remov
e
(
self
.
TEST_INDEX_FILENAME
)
remove_fil
e
(
self
.
TEST_INDEX_FILENAME
)
common/test/acceptance/tests/lms/test_lms_course_discovery.py
View file @
b4c4e818
...
@@ -7,6 +7,7 @@ import json
...
@@ -7,6 +7,7 @@ import json
import
os
import
os
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.web_app_test
import
WebAppTest
from
..helpers
import
remove_file
from
...pages.common.logout
import
LogoutPage
from
...pages.common.logout
import
LogoutPage
from
...pages.studio.auto_auth
import
AutoAuthPage
from
...pages.studio.auto_auth
import
AutoAuthPage
from
...pages.lms.discovery
import
CourseDiscoveryPage
from
...pages.lms.discovery
import
CourseDiscoveryPage
...
@@ -30,7 +31,7 @@ class CourseDiscoveryTest(WebAppTest):
...
@@ -30,7 +31,7 @@ class CourseDiscoveryTest(WebAppTest):
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
json
.
dump
({},
index_file
)
json
.
dump
({},
index_file
)
self
.
addCleanup
(
os
.
remov
e
,
self
.
TEST_INDEX_FILENAME
)
self
.
addCleanup
(
remove_fil
e
,
self
.
TEST_INDEX_FILENAME
)
super
(
CourseDiscoveryTest
,
self
)
.
setUp
()
super
(
CourseDiscoveryTest
,
self
)
.
setUp
()
self
.
page
=
CourseDiscoveryPage
(
self
.
browser
)
self
.
page
=
CourseDiscoveryPage
(
self
.
browser
)
...
...
common/test/acceptance/tests/lms/test_lms_courseware_search.py
View file @
b4c4e818
...
@@ -7,7 +7,7 @@ import json
...
@@ -7,7 +7,7 @@ import json
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
flaky
import
flaky
from
flaky
import
flaky
from
..helpers
import
UniqueCourseTest
from
..helpers
import
UniqueCourseTest
,
remove_file
from
...pages.common.logout
import
LogoutPage
from
...pages.common.logout
import
LogoutPage
from
...pages.studio.utils
import
add_html_component
,
click_css
,
type_in_codemirror
from
...pages.studio.utils
import
add_html_component
,
click_css
,
type_in_codemirror
from
...pages.studio.auto_auth
import
AutoAuthPage
from
...pages.studio.auto_auth
import
AutoAuthPage
...
@@ -49,7 +49,7 @@ class CoursewareSearchTest(UniqueCourseTest):
...
@@ -49,7 +49,7 @@ class CoursewareSearchTest(UniqueCourseTest):
# create test file in which index for this test will live
# create test file in which index for this test will live
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
json
.
dump
({},
index_file
)
json
.
dump
({},
index_file
)
self
.
addCleanup
(
os
.
remov
e
,
self
.
TEST_INDEX_FILENAME
)
self
.
addCleanup
(
remove_fil
e
,
self
.
TEST_INDEX_FILENAME
)
super
(
CoursewareSearchTest
,
self
)
.
setUp
()
super
(
CoursewareSearchTest
,
self
)
.
setUp
()
self
.
courseware_search_page
=
CoursewareSearchPage
(
self
.
browser
,
self
.
course_id
)
self
.
courseware_search_page
=
CoursewareSearchPage
(
self
.
browser
,
self
.
course_id
)
...
...
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