Open K0nkere opened 2 years ago
description of os.path functions
from pathlib import Path
path = Path(__file__).resolve()
from pathlib import Path
path = Path(__file__).parent
path_to_script = os.path.split(__file__)[0]
pre_parent = os.path.split(path_to_script)[0]
As soon as I am creating unit tests for the prediction service its need open a new VSCode window choosing /project/prediction_service/ as start folder and create tests folder in it.
Launching
pipenv shell
and its need to add pytest as a dev packagepipenv install --dev pytest
which python > path to python > CTRL+SHIFT+P and Input new Interpreter > Select Interpreter
There is a convention for naming test files so its need to create two files in the tests folder__init__.py
- init filetest_predict.py
- file that contains unit tests !!! the name of folder that contain tests == tests is obligatory and important !!! scripts name in format test_***.py is important !!!When we !!! clone the repo and install the pipenv from Pipfile !!! via
pipenv install
if we want to install all --dev dependences from it its need to runpipenv install --dev lib1 lib2 lib3
- for the development purposes like tests, linting, black and etcBetter to do it at start example
pipenv install -r requirements.txt --dev deepdiff --python=3.9