https://github.com/coderoad/pytest-coderoad-deprecated
Python PyTest Test Runner for CodeRoad
https://github.com/coderoad/pytest-coderoad-deprecated
Last synced: 4 months ago
JSON representation
Python PyTest Test Runner for CodeRoad
- Host: GitHub
- URL: https://github.com/coderoad/pytest-coderoad-deprecated
- Owner: coderoad
- Created: 2016-03-23T05:45:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-05T21:27:17.000Z (over 9 years ago)
- Last Synced: 2024-10-16T03:32:27.755Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://coderoad.github.io
- Size: 64.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# PyTest CodeRoad
[PyTest](http://pytest.org/latest/) Python test runner for [Atom-CodeRoad](https://github.com/coderoad/atom-coderoad).
[Learn more about CodeRoad](https://coderoad.github.io), an interactive coding tutorial creator built inside of Atom.
### Setup
Install Python
pip install -U pytest
pip install tap.py
### Writing Tests
There are two parts your tests will need: a **task number** and a **feedback message**. You'll also need to load user created **workspace files** to run the tests on. You may also want to load additional **data files**.
##### Task number
Class title specifying the task number: `class Test##`
class Test01:
# tests here
class Test02:
# tests here
##### Feedback message
Test method providing the feedback message and starting with `test_`
class Test01:
def test_b_is_not_true(self):
assert b == True
# fails with message "b is not true"
def test_a_is_not_one(self):
assert a == 1
# fails with message "a is not one"
##### Loading Files
**Workspace files** (created by the user) can be loaded inside of comments
# load('file.py')
These files will be loaded from the users working directory.
**Data files** can be loaded by setting a second parameter to `true`.
# load('path/to/data.py', true)
Data files will load from the specified tutorial directory in *package.json*.
*package.json*
config {
tutorialDir: 'tutorial'
}
##### Complete Example
See the [examples](//github.com/coderoad/pytest-coderoad) directory.