Skip to content

pytest plugin to send email after execution with execution info

License

Notifications You must be signed in to change notification settings

roberfi/pytest-email

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 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="username" --epwd="XXXXX" --efrom="from@gmail.com" --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 (for auth)
    -> --epwd - Email user password
    -> --efrom - sender email id
    -> --eto - Recipients email ids
    -> --esmtp - Email server smtp
    -> --esubject - Email subject
    -> --eorg - Organization name to include in email
    -> --esend - Send email based on input
    -> --eanon - Do not use SMTP auth
    -> --eforcessl - If set, force secure connection when SSL is required and starttls is not supported
    

    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

  • Python 100.0%