This repository contains the code for the Coaching Companion project. The project is a set of migration tools that provides an internal package for Cultivate Learning engineers to modernize the existing database design. The project is built using Python and Jupyter Notebooks.
To get started with your development (or fork), click the "Open with GitHub Codespaces" button below to launch a fully configured development environment with all the necessary tools and extensions.
To run your tests using pytest from the terminal, follow these steps:
- Navigate to Your Project Directory: Open your terminal and navigate to the root directory of your project where your tests are located.
Run pytest: Execute the following command to run all tests:
pytest
- Run Specific Tests: To run a specific test file or directory, provide the path:
pytest path/to/test_file.py
- View Detailed Output: For more detailed output, use the -v (verbose) flag:
pytest -v
- Generate a Test Report: To generate a test report, you can use the --junitxml option:
pytest --junitxml=report.xml
By following these steps, you can easily run and manage your tests using pytest from the terminal.
Access the tests/utils/generate_list_of_models.ipynb
notebook to generate a list of SQLModels from the database schema. This step is optional and only required if you want to update mulitple models. This notebook allows you to retrieve models in batches.
The output of this notebook is a list of SQLModels in a YAML file that can be used to generate unit tests.
Access the tests/utils/generate_test_from_template.ipynb
notebook to generate unit tests from the templates. This step is required if you want to update mulitple models. This notebook allows you to generate tests in batches. Currently, the template is based on models inheriting the BaseTableModel class, and you will need to add a new template for other models.
As written, the notebook will generate unit tests for the models in the tests/models/
directory.