To connect to Snowflake, create a connection parameters file under tests/parameters.py, and add the
following code snippet with your parameters:
CONNECTION_PARAMETERS = {
'account': '<account>',
'user': '<user>',
'password': '<password>',
'role': '<role>',
'database': '<database>',
'schema': '<schema>',
'warehouse': '<warehouse>',
}Note that this file will be ignored by git, so you do not need to worry about check in your secret.
As you configure the Pycharm correctly, you can simply run the test by clicking the play button on Pycharm.
You can run a test on a terminal using pytest, as the example below:
pytest tests/integ
pytest tests/integ/test_dataframe.py
pytest tests/integ/test_dataframe.py -k "test_filter"Install tox within your environment
pip install toxYou can run the linter, all integration and unit tests as well as generate a code coverage report with tox. To run all three functions run the following command:
python -m toxNote: To view a human-readable code coverage output, open up the html code coverage output in
your web browser. This will be located in <project_dir>/.tox/htmlcov
To just run the all Snowpark tests, run the following command:
# Must have Python 3.8 for the tests to run
python -m tox -e py38