Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
75adbb2c
Commit
75adbb2c
authored
Feb 17, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pyinstrument instead.
parent
153ca29c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
requirements/test-acceptance.txt
+1
-0
test/acceptance/tests.py
+19
-8
No files found.
requirements/test-acceptance.txt
View file @
75adbb2c
bok-choy==0.4.10
bok-choy==0.4.10
ddt==1.0.0
ddt==1.0.0
nose==1.3.7
nose==1.3.7
pyinstrument==0.13.1
test/acceptance/tests.py
View file @
75adbb2c
...
@@ -892,18 +892,29 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
...
@@ -892,18 +892,29 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
super
(
FullWorkflowOverrideTest
,
self
)
.
setUp
(
"full_workflow_staff_override"
,
staff
=
True
)
super
(
FullWorkflowOverrideTest
,
self
)
.
setUp
(
"full_workflow_staff_override"
,
staff
=
True
)
import
cProfile
,
pstats
,
StringIO
# import cProfile, pstats, StringIO
pr
=
cProfile
.
Profile
()
pr
.
enable
()
# pr = cProfile.Profile()
# pr.enable()
from
pyinstrument
import
Profiler
self
.
profiler
=
Profiler
()
self
.
profiler
.
start
()
self
.
staff_area_page
=
StaffAreaPage
(
self
.
browser
,
self
.
problem_loc
)
self
.
staff_area_page
=
StaffAreaPage
(
self
.
browser
,
self
.
problem_loc
)
self
.
addCleanup
(
pr
.
disable
)
# self.addCleanup(pr.disable)
# self.addCleanup(self.profiler.stop)
# self.addCleanup(self.log_to_file, profiler)
# self.addCleanup(self.break_fix, pr)
# self.addCleanup(self.break_fix, pr)
self
.
addCleanup
(
pr
.
dump_stats
,
'ben.log'
)
# self.addCleanup(pr.dump_stats, 'ben.log')
def
log_to_file
(
self
):
with
open
(
'profile.log'
,
'w'
)
as
f
:
f
.
write
(
self
.
profiler
.
output_text
())
def
log_to_file
(
pr
):
def
tearDown
(
self
):
with
open
(
'w'
,
'profile.log'
)
as
f
:
self
.
profiler
.
stop
()
f
.
write
(
pr
.
print_stats
()
)
self
.
log_to_file
(
)
# def break_fix(self, pr):
# def break_fix(self, pr):
# from nose.tools import set_trace
# from nose.tools import set_trace
...
...
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