Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ git:
depth: 100
install:
- if [ $USE_MICROPYTHON = false ]; then pip install Pillow Sphinx sphinx_bootstrap_theme recommonmark evdev==1.0.0 && pip install -r ./docs/requirements.txt; fi
- if [ $USE_MICROPYTHON = true ]; then ./.travis/install-micropython.sh && PYTHON=~/micropython/ports/unix/micropython; else PYTHON=python3; fi
- if [ $USE_MICROPYTHON = true ]; then ./.travis/install-micropython.sh && MICROPYTHON=~/micropython/ports/unix/micropython; fi
script:
- chmod -R g+rw ./tests/fake-sys/devices/**/*
- if [ $USE_MICROPYTHON = false ]; then $PYTHON -W ignore tests/api_tests.py; fi
- if [ $USE_MICROPYTHON = true ]; then $PYTHON tests/api_tests.py; fi
- if [ $USE_MICROPYTHON = false ]; then python3 -W ignore::ResourceWarning tests/api_tests.py; fi
Comment thread
dwalton76 marked this conversation as resolved.
Resolved
- if [ $USE_MICROPYTHON = true ]; then $MICROPYTHON tests/api_tests.py; fi
- if [ $USE_MICROPYTHON = false ]; then sphinx-build -nW -b html ./docs/ ./docs/_build/html; fi
deploy:
provider: pypi
Expand Down
24 changes: 21 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,28 @@ when you git clone. Example:
$ git clone --recursive https://github.com/ev3dev/ev3dev-lang-python.git
```

# Running Tests
To run the tests do:
# Running Tests with CPython (default)
To run the tests:
```
$ cd ev3dev-lang-python/
$ chmod -R g+rw ./tests/fake-sys/devices/**/*
$ python3 -W ignore ./tests/api_tests.py
$ python3 -W ignore::ResourceWarning tests/api_tests.py
```

If on Windows, the `chmod` command can be ignored.

# Running Tests with Micropython

This library also supports a subset of functionality on [Micropython](http://micropython.org/).

You can follow the instructions on [the Micropython wiki](https://github.com/micropython/micropython/wiki/Getting-Started)
or check out our [installation script for Travis CI workers](https://github.com/ev3dev/ev3dev-lang-python/blob/ev3dev-stretch/.travis/install-micropython.sh)
to get Micropython installed. If following the official instructions,
make sure you install the relevant micropython-lib modules listed in the linked script as well.

Once Micropython is installed, you can run the tests with:

```
$ cd ev3dev-lang-python/
$ micropython tests/api_tests.py
```