example-code-2e/01-data-model
2021-02-14 20:28:07 -03:00
..
data-model.ipynb ch01: automated tests 2019-11-20 19:46:31 -03:00
frenchdeck.doctest update from atlas 2015-03-31 16:53:46 -03:00
frenchdeck.py update from atlas 2015-03-31 16:53:46 -03:00
README.md ch01: automated tests 2019-11-20 19:46:31 -03:00
test.sh ch01: automated tests 2019-11-20 19:46:31 -03:00
vector2d.doctest ch01-12: clean up by @eumiro 2021-02-14 20:28:07 -03:00
vector2d.py ch01-12: clean up by @eumiro 2021-02-14 20:28:07 -03:00

The Python Data Model

Sample code for Chapter 1 of Fluent Python 2e by Luciano Ramalho (OReilly, 2020)

Running the tests

Doctests

Use Pythons standard doctest module to check stand-alone doctest file:

$ python3 -m doctest frenchdeck.doctest -v

And to check doctests embedded in a module:

$ python3 -m doctest vector2d.py -v

Jupyter Notebook

Install pytest and the nbval plugin:

$ pip install pytest nbval

Run:

$ pytest --nbval