All Projects → shashikumarraja → pytest_tutorial

shashikumarraja / pytest_tutorial

Licence: MIT License
No description or website provided.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytest tutorial

python-ood
💠 Essential object oriented design (python, pytest, travisCI)
Stars: ✭ 38 (+90%)
Mutual labels:  pytest
pytest-localstack
Pytest plugin for local AWS integration tests
Stars: ✭ 66 (+230%)
Mutual labels:  pytest
pytest-it
Decorate your pytest suite with RSpec-style pytest markers, then run `pytest --it` to see a plaintext spec of the test structure.
Stars: ✭ 26 (+30%)
Mutual labels:  pytest
pytest-watcher
Rerun pytest when your code changes
Stars: ✭ 60 (+200%)
Mutual labels:  pytest
pytest-pytorch
pytest plugin for a better developer experience when working with the PyTorch test suite
Stars: ✭ 36 (+80%)
Mutual labels:  pytest
jwql
The James Webb Space Telescope Quicklook Application
Stars: ✭ 42 (+110%)
Mutual labels:  pytest
bioinf-commons
Bioinformatics library in Kotlin
Stars: ✭ 21 (+5%)
Mutual labels:  hypothesis-testing
pytest-arraydiff
pytest plugin to facilitate comparison of results to a pre-defined reference
Stars: ✭ 12 (-40%)
Mutual labels:  pytest
pytest-notebook
A pytest plugin for regression testing and regenerating Jupyter Notebooks
Stars: ✭ 35 (+75%)
Mutual labels:  pytest
myrepo
continuous integration rep
Stars: ✭ 41 (+105%)
Mutual labels:  pytest
hypothetical
Hypothesis and statistical testing in Python
Stars: ✭ 49 (+145%)
Mutual labels:  hypothesis-testing
python-page-object
📔 Page object design pattern implementation (python, pom, selenium, pytest, travisCI)
Stars: ✭ 41 (+105%)
Mutual labels:  pytest
pytest-snapshot
A plugin for snapshot testing with pytest.
Stars: ✭ 68 (+240%)
Mutual labels:  pytest
pytest-mock-server
Mock server plugin for pytest
Stars: ✭ 19 (-5%)
Mutual labels:  pytest
openverse-catalog
Identifies and collects data on cc-licensed content across web crawl data and public apis.
Stars: ✭ 27 (+35%)
Mutual labels:  pytest
pytest-spark
pytest plugin to run the tests with support of pyspark
Stars: ✭ 65 (+225%)
Mutual labels:  pytest
lovely-pytest-docker
Pytest plugin providing the ability to use docker-compose services as fixtures.
Stars: ✭ 73 (+265%)
Mutual labels:  pytest
pytest-flakes
pytest plugin for running pyflakes
Stars: ✭ 42 (+110%)
Mutual labels:  pytest
django-ecommerce-project
The Django-Ecommerce is an open-source project initiative and tutorial series built with Python and the Django Framework.
Stars: ✭ 182 (+810%)
Mutual labels:  pytest
pytest-faulthandler
py.test plugin that activates the fault handler module during testing
Stars: ✭ 27 (+35%)
Mutual labels:  pytest

PYTEST TUTORIAL

python 2.7 pytest 3.6.4 allure_pytest 2.5.0 pytest_html 1.19.0 xdist 1.22.5 Build Status Coverage Status Updates Python 3

Contains pytest scripts which helps in understanding different pytest functionalities and features.

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.

An example of a simple test:

# content of test_sample.py
def inc(x):
    return x + 1
#make sure the test function's name starts with 'test_'
def test_answer():
    assert inc(3) == 5

How to Run the project?

  1. Clone/download this repo

  2. Install all the dependencies using-

pip install -r requirements.txt
  1. Tests are located inside src/tests/
pytest src/tests
  1. To run tests and generate html report
pytest src/tests --html=report.html --self-contained-html

alt text

  1. To run tests and generate allure report
#make sure report directory exists in the root folder
pytest src/tests --alluredir=report/

#To view the allure report
allure serve report/

alt text

  1. To run tests with code coverage report
pytest --cov=src --verbose

alt text

  1. To run tests with multiple cpu cycles(will speed up the test execution by running them in parallel)
pytest src/tests -n 5
  1. To fix liniting errors the project uses autopep8. To modify a file in place (with aggressive level 2):
$ autopep8 --in-place --aggressive --aggressive <filename>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].