When submitting a pull request, please ensure your changes meet the following requirements:

  • Pull request points to dev (development) branch.
  • Changes are squashed into a single commit.
  • Commit message is in present tense (e.g. “Add foo” over “Added foo”).
  • Sphinx-compatible docstrings.
  • PEP8 compliance.
  • Test coverage remains at %100.
  • No build failures on TravisCI.
  • Up-to-date documentation (see below).
  • Maintains backward-compatibility.
  • Maintains compatibility with Python 2.7+ and 3.4+.


Run flake8 to check style:

~$ pip install flake8
~$ git clone
~$ cd binarytree
~$ flake8


Run unit tests:

~$ pip install pytest
~$ git clone
~$ cd binarytree
~$ py.test --verbose

Run unit tests with coverage:

~$ pip install coverage pytest pytest-cov
~$ git clone
~$ cd binarytree
~$ py.test --cov=binarytree --cov-report=html

# Open the generated file htmlcov/index.html in a browser


Documentation uses reStructuredText and Sphinx. To build locally:

~$ pip install sphinx sphinx_rtd_theme
~$ git clone
~$ cd binarytree/docs
~$ sphinx-build . build
# Open build/index.html in a browser