Skip to content

Testing in python 2 and 3

Steve edited this page Nov 20, 2017 · 9 revisions

Install python

$ brew install python python3
$ git clone https://github.com/siznax/wptools.git
$ cd wptools

Test in python2

$ mkvirtualenv --python=`which python2` wptools
[wptools]$ pip install --upgrade pip
[wptools]$ pip install -r requirements.txt
[wptools]$ pip install nose
[wptools]$ nosetests tests/test_basic.py
Ran 58 tests in 0.844s

OK

Test in python3

$ mkvirtualenv --python=`which python3` wptools_py3
[wptools_py3]$ pip install --upgrade pip
[wptools_py3]$ pip install -r requirements.txt
[wptools_py3]$ pip install nose
[wptools_py3]$ nosetests tests/test_basic.py
Ran 58 tests in 0.507s

OK

Advanced tests

A small number of tests with random lang, title input.

$ python tests/test_advanced.py

Stress testing

New features should be stress tested. We get a random language (from over 100 choices) and get a random title from the Wikipedia at that language and do a get(), forever.

python tests/stress.py

Clone this wiki locally