https://github.com/rahulmoundekar/pytest-simple-app-demo
pytest simple example
https://github.com/rahulmoundekar/pytest-simple-app-demo
pytest python-3
Last synced: 7 months ago
JSON representation
pytest simple example
- Host: GitHub
- URL: https://github.com/rahulmoundekar/pytest-simple-app-demo
- Owner: rahulmoundekar
- Created: 2020-05-16T14:55:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T19:54:13.000Z (about 5 years ago)
- Last Synced: 2024-12-28T03:27:23.241Z (over 1 year ago)
- Topics: pytest, python-3
- Language: Python
- Size: 7.68 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Pytest With Python :

pytest is a framework that makes building simple and scalable tests easy. Tests are expressive and readable—no boilerplate code required. Get started in minutes with a small unit test or complex functional test for your application or library.
Pytest is a testing framework which allows us to write test codes using python. You can write code to test anything like database , API, even UI if you want. But pytest is mainly being used in industry to write tests for APIs.
# Why use PyTest?
* Very easy to start with because of its simple and easy syntax.
* Can run tests in parallel.
* Can run a specific test or a subset of tests
* Automatically detect tests
* Skip tests
* Open source
#### Pre Requisites
- Making the project as :
```
mkdir pytest-simple-app-demo
cd pytest-simple-app-demo
```
- Web Scraping installation:
```
open command prompt type
pip install virtualenv
create virtualenv
>>virtualenv venv
we need to activate virtualenv for use
>>venv\scripts\activate
need libraries for Web Scraping :
pip install -U pytest
pytest --version
```
#### Test files and Test methods
* By default pytest only identifies the file names starting with test_ or ending with _test as the test files.
* Pytest requires the test method names to start with "test."
All other method names will be ignored even if we explicitly ask to run those methods.
- In order to execute code
* To run tests only from a specific file
pytest test_TestDemo.py