This guide will help you set up a virtual environment, install dependencies, and run tests using pytest.
- Python 3.10+ (Python 3.10 or later is recommended)
- pip (typically included with Python)
-
Open your terminal.
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
-
Run tests using pytest:
pytest <path to the test script>
-
Open Command Prompt or PowerShell.
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
Command Prompt:
venv\Scripts\activate
-
PowerShell:
.\venv\Scripts\Activate.ps1
-
-
Install the required packages:
pip install -r requirements.txt
-
Run tests using pytest:
pytest <path to the test script>
-
Deactivating the Virtual Environment:
When you are done, you can deactivate the environment by simply running:deactivate
-
Troubleshooting:
If you encounter issues with running pytest, ensure it is included in yourrequirements.txtor install it manually:pip install pytest
With these steps, you should have your environment set up for development and testing.