Skip to content

Commit 77ce467

Browse files
authored
Update README.md
1 parent 9fd6479 commit 77ce467

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ Before we set up Pytest in VS Code, you need to install the below prerequisites
1313
## Setting Up Pytest In VS Code
1414
To set up Pytest in VS Code, follow the steps described below-
1515
Check the pip version installed and use the set up version to work with pytest -
16-
* Pip3 install pytest
17-
* Pip3 show pytest : To check the version
16+
* Pip install pytest
1817

1918
## Installing Python Extension in VS Code
2019
Open your VS Code and search for Python on the extensions. You’ll find the Python extension at the top of the search result. Select and click install.
@@ -31,9 +30,12 @@ Now click on “Configure Python Tests”, select pytest and the test code libra
3130
## Settting up virtual environment
3231
Pytest is particularly effective in virtual environments when VSCode is utilized. A virtual environment is a way to create an environment that is built-in. A folder is created by a virtual environment that contains a copy to a specific interpreter. Installing packages in a virtual environment will result in a new folder that is isolated from other packages used by other workspaces.
3332
Working in virtual environments-
34-
Pyenv is a library to work with different python environments-
35-
* brew install pyenv
36-
* pyenv install 3.13
33+
open the Command Palette (⇧⌘P), search for the Python: Create Environment command, and select it
34+
35+
![image](https://github.com/user-attachments/assets/3083643c-9b79-4188-9dfa-70d7f3f502b4)
36+
37+
If you are creating an environment using Venv, the command presents a list of interpreters that can be used as a base for the new virtual environment.
38+
The Python: Select Interpreter command displays a list of available environments, select the virtual env
3739

3840
## Add libraries to be used in the package to requirements.txt :
3941
**Set up requirements.txt for required packages**
@@ -46,7 +48,7 @@ Pyenv is a library to work with different python environments-
4648
* [pytest-cov](https://pypi.org/project/pytest-cov/) : pytest plugin to render coverage reports.
4749
* pre-commit : maange pre commit hooks
4850

49-
To install the set up: pip3 install -r requirements.txt
51+
To install the set up: pip install -r requirements.txt
5052

5153
## Report view in VScode console TEST RESULTS :
5254
The report view provides report after execution of tests in TEST RESULTS tab in VScode. The results are in html format using pytest-html format of report structure woth pytest-cov that gives stats on test execution and code coverage at the end of each run.

0 commit comments

Comments
 (0)