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
e0fb13a2
Commit
e0fb13a2
authored
Apr 19, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resized test pyramid image
Fixed mistake in pip install snippet
parent
85ea5f73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
doc/development.md
+0
-1
doc/test_pyramid.png
+0
-0
doc/testing.md
+4
-6
No files found.
doc/development.md
View file @
e0fb13a2
...
@@ -12,7 +12,6 @@ This will read the `Gemfile` and install all of the gems specified there.
...
@@ -12,7 +12,6 @@ This will read the `Gemfile` and install all of the gems specified there.
Run the following::
Run the following::
pip install -r requirements.txt
pip install -r requirements.txt
pip install -r test-requirements.txt
### Binaries
### Binaries
...
...
doc/test_pyramid.png
View replaced file @
85ea5f73
View file @
e0fb13a2
28.3 KB
|
W:
|
H:
24.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
doc/testing.md
View file @
e0fb13a2
...
@@ -6,15 +6,13 @@ We maintain three kinds of tests: unit tests, integration tests,
...
@@ -6,15 +6,13 @@ We maintain three kinds of tests: unit tests, integration tests,
and acceptance tests.
and acceptance tests.
### Unit Tests
### Unit Tests
*
As a rule of thumb, you should write at least one test for
every "branch" of code.
If a function does X when A and does Y when NOT A,
then you need to write two tests: a test for A and a test for NOT A.
*
Each test case should be concise: setup, execute, check, and teardown.
*
Each test case should be concise: setup, execute, check, and teardown.
If you find yourself writing tests with many steps, consider refactoring
If you find yourself writing tests with many steps, consider refactoring
the unit under tests into smaller units, and then testing those individually.
the unit under tests into smaller units, and then testing those individually.
*
As a rule of thumb, your unit tests should cover every code branch.
*
Mock or patch external dependencies.
*
Mock or patch external dependencies.
We use
[
voidspace mock
](
http://www.voidspace.org.uk/python/mock/
)
.
We use
[
voidspace mock
](
http://www.voidspace.org.uk/python/mock/
)
.
...
@@ -87,7 +85,7 @@ because the `capa` package handles problem XML.
...
@@ -87,7 +85,7 @@ because the `capa` package handles problem XML.
Before running tests, ensure that you have all the dependencies. You can install dependencies using:
Before running tests, ensure that you have all the dependencies. You can install dependencies using:
pip install requirements.txt
pip install
-r
requirements.txt
## Running Python Unit tests
## Running Python Unit tests
...
@@ -186,7 +184,7 @@ To test only a specific feature:
...
@@ -186,7 +184,7 @@ To test only a specific feature:
**Troubleshooting**
: If you get an error message that says something about harvest not being a command, you probably are missing a requirement.
**Troubleshooting**
: If you get an error message that says something about harvest not being a command, you probably are missing a requirement.
Try running:
Try running:
pip install requirements.txt
pip install
-r
requirements.txt
## Viewing Test Coverage
## Viewing Test Coverage
...
...
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