Jump to: navigation, search

Difference between revisions of "Trove/unit-testing"

(Created page with "= Setup = First need to do a "pip install tox" In order to run tox for torve you will need to install the libmysqlclient-dev and python-dev libraries == Ubuntu == * sudo apt...")
 
m (Running Tests)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
First need to do a "pip install tox"
 
First need to do a "pip install tox"
  
In order to run tox for torve you will need to install the libmysqlclient-dev and python-dev libraries
 
 
== Ubuntu ==
 
== Ubuntu ==
 
* sudo apt-get install libmysqlclient-dev
 
* sudo apt-get install libmysqlclient-dev
 
* sudo apt-get install python-dev
 
* sudo apt-get install python-dev
 
* sudo apt-get install libxml2-dev libxslt1-dev
 
* sudo apt-get install libxml2-dev libxslt1-dev
 +
* sudo apt-get install libpq-dev
  
 
== Mac OSX ==
 
== Mac OSX ==
Line 15: Line 15:
 
= Running Tests =
 
= Running Tests =
  
To run all tests and PEP8, run tox, like so:
+
To run all tests and PEP8, run tox within the trove repository directory, like so:
  
 
$ tox
 
$ tox
  
To run just the tests for Python 2.7, run:
+
To run just the tests for Python 3.9, run:
  
$ tox -epy27
+
$ tox -epy39
  
 
To run just PEP8, run:
 
To run just PEP8, run:

Latest revision as of 08:16, 9 August 2023

Setup

First need to do a "pip install tox"

Ubuntu

  • sudo apt-get install libmysqlclient-dev
  • sudo apt-get install python-dev
  • sudo apt-get install libxml2-dev libxslt1-dev
  • sudo apt-get install libpq-dev

Mac OSX

  • brew install mysql
  • brew install python-dev

Running Tests

To run all tests and PEP8, run tox within the trove repository directory, like so:

$ tox

To run just the tests for Python 3.9, run:

$ tox -epy39

To run just PEP8, run:

$ tox -epep8

To generate a coverage report,run:

$ tox -ecover