Skip to content

pytest plugin to send email after execution with execution info

License

Notifications You must be signed in to change notification settings

patel-5788/pytest-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytest-email

Plugin to send email after execution with results.

PyPI version Downloads PRs Welcome Maintenance Open Source Love png1


How it works:

  • Get execution details using pytest_terminal_summary() hook
  • Build html template
  • Send's email for respective recipients

How to use in project:

  1. Install pytest-email

    Case 1: Using pip

    pip install pytest-email
    

    Case 2: Using setup.py (clone repo and run command in root)

    python setup.py install
    

    Case 3: Install from git (changes in master)

    pip install git+https://github.com/adiralashiva8/pytest-email
    
  2. Execute test's normally using options

    pytest --euname="test@gmail.com" --epwd="XXXXX" --eto="test1@gmail.com,test2@gmail.com"
    

    By default send email is false, users need to enable send email by using following command

    pytest --esend=True
    

    Email options:

    -> --euname - Email user name or id
    -> --epwd - Email user password
    -> --eto - Recipients email ids
    -> --esmtp - Email server smtp
    -> --esubject - Email subject
    -> --eorg - Organization name to include in email
    -> --esend - Send email based on input
    

    USAGE

    pytest --esend=True --euname="test@gmail.com" --epwd="XXXXX" --eto="test1@gmail.com,test2@gmail.com" --esubject="ABC Project Execution" --eorg="MyCompany" --esmtp="smtp.xxxx.4578"
    

Sample Report

pytest_email.jpg


What kind of information is shared?

Following test counts:

  • Total
  • Passed
  • Failed
  • Skipped
  • Error
  • XPassed
  • XFailed
  • Duration

Future: Failed test information


Thanks for using pytest-email!

If you have any questions / suggestions / comments on this, please feel free to reach me at


Credits


⭐ repo if you like it

About

pytest plugin to send email after execution with execution info

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages