Unit test fixtures in Python?

Submitted 3 years, 7 months ago
Ticket #158
Views 236
Language/Framework Python
Priority Medium
Status Closed

I'm writing a library in Python which makes calls to a REST API, receives results in JSON, and returns Python class instances after transforming the results.

Is there a generally accepted way of including test fixtures (ie JSON files to test against) inside of the Python package and test namespace to load and test against in your test cases?

Submitted on Sep 13, 20
add a comment

1 Answer

Verified

pip install flask-fixtures

If you are going to use JSON as your data serialization format, you
should also consider installing the dateutil package since it will
add much more powerful and flexible parsing of dates and times.

To install the library from source simply download the source code, or check it out if you have git installed on your system, then just run the install command.

git clone https://github.com/croach/Flask-Fixtures.git
cd /path/to/flask-fixtures
python setup.py install

Submitted 3 years, 6 months ago


Latest Blogs