PKKKJiZpytest_notify.py"""Get notifications when your tests ends""" from collections import Counter import os import subprocess __version__ = "0.1.4" counter = Counter() def notify(title, body, icon=None): args = ['notify-send', title, body] if icon: if not os.path.isabs(icon): pwd = os.getcwd() os.path.join(pwd, icon) args += ["--icon", icon] subprocess.check_call(args) def pytest_addoption(parser): group = parser.getgroup('notify') group.addoption( '--notify-disable', action='store_true', dest='notify_disable', help='Disable notifications' ) parser.addini('HELLO', 'Dummy pytest.ini setting') def pytest_runtest_logreport(report): if report.when == "setup" and report.outcome == "skipped": counter["skipped"] += 1 if report.when != "call": return counter[report.outcome] += 1 def pytest_unconfigure(config): if config.option.notify_disable: return passed = counter["failed"] == 0 title = "Tests passed" if passed else "Tests failed" body_parts = [] for state in ("passed", "skipped", "failed"): if counter[state]: plural = "s" if counter[state] > 1 else "" msg = "{} test{} {}".format(counter[state], plural, state) body_parts.append(msg) if body_parts: body = "\n".join(body_parts) notify(title, body) PKKKJo"".pytest_notify-0.1.4.dist-info/entry_points.txt[pytest11] notify = pytest_notify PKKKJ ??%pytest_notify-0.1.4.dist-info/LICENSE The MIT License (MIT) Copyright (c) 2017 Alexandre Bonnetain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!HIWd#pytest_notify-0.1.4.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q0343 /, (-JLR()*M ILR(4KM̫#DPK!HeB>Z&pytest_notify-0.1.4.dist-info/METADATASK0WVH{٤]iaE Zui2c{Ғ8 RE3.4@fp>Wk]cM:CuRmں־2+k -tAw5&.bnBXUOsW/6QDG}]XVw-Wgpg𧶅Gx㬕dY&6m'QPxF5 fwM Nc1$o)Ϋ2]*uQ0Cg*M*$6F4{m^:0zr2־D_7(5d ذ6I~?^Pݘ1H:FciqrUT#dQ욙lԶ‰~#s!K jsUd8J+oYJ.Qk- +^D'/=Ȯzԓ=*DW[]kEKq{t"i݁LdAm-,)ۈk),Ԍ= JL>>ؘ$ gD^Ǵ=޹#a޲ؘKn+qP\j2v00 Q.Ax/PK!HR./$pytest_notify-0.1.4.dist-info/RECORDOB@} eLyqT<0eNO8|^ӬIP鹶H}s.X+Q3qW=M;)կEg?ċ[:o4@;: fgvr-;~ժꥭg L DŽژ j&!pNğ r1ǟ<s߻rm+aU5rơ1TR"P[0-=G=O̐*C.WOtEX5G׎a~ ,PKKKJiZpytest_notify.pyPKKKJo"".pytest_notify-0.1.4.dist-info/entry_points.txtPKKKJ ??%+pytest_notify-0.1.4.dist-info/LICENSEPK!HIWd# pytest_notify-0.1.4.dist-info/WHEELPK!HeB>Z&E pytest_notify-0.1.4.dist-info/METADATAPK!HR./$ pytest_notify-0.1.4.dist-info/RECORDPK8