Skip to content

sc0v0ne/article_apply_test_in_jupyter_notebook

Repository files navigation

Article apply test in jupyter notebook

I created this project to redo a college project. Where I applied methods from the refactoring book.

Post Dev.to

📗 Book: Refactoring - Improving the design of existing code - Martin Fowler

FOWLER, Martin. “Replace Query with Parameter” no código. In: REFATORAÇÃO: Aperfeiçoando o design de códigos existentes. 2. ed. [S. l.: s. n.], 2019. cap. 11.

Inicialize this project:

  • Poetry installed

  • 2º step:

poetry shell
  • 3º step:
poetry install
  • 4º step:
jupyter notebook
  • 5º step tests:
pytest -v

Update warning notebook:

Warning:

.venv/lib/python3.9/site-packages/jupyter_client/connect.py:20
  /home/machine_user/Documents/projects_github/replace_query_with_parameter/.venv/lib/python3.9/site-packages/jupyter_client/connect.py:20: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6
    from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Execute in terminal:

export JUPYTER_PLATFORM_DIRS=1
jupyter --paths