Saravanan666/pypi-org huggingface dataset:
Package: pytest-rocketchat
pytest-rocketchatPytest toRocketChatreporting plugin.Inspired bypytest-slack&pytest-messenger.Usage$ pytest --rocketchat_domain=https://your.chat --rocketchat_username=username --rocketchat_password=password --rocketchat_channel=channelOptions:--rocketchat_domain* (Required)--rocketchat_username* (Required)--rocketchat_password* (Required)--rocketchat_channel* (Required)--rocketchat_report_link--rocketchat_message_prefix--rocketchat_timeout--rocketchat_success_emoji--rocketchat_failed_emoji--ssl_verifyRequirementsPython >= 3.6RequestsRocketchat_APIInstallationYou can install "pytest-rocketchat" viapip:$ pip install pytest-rocketchatIf you encounter any problems, please file anissuealong with a detailed description.
Package: pytest-rotest
Integration with rotestThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesFull support for running Rotest tests (TestCases and TestFlows)Global resource managerGlobal Rotest result object--ipdbuggerflag for setting up the ipdbugger wrapper (-Dor--debugin Rotest cli)--outputscmd option for setting up output handlers (-oor--outputsin Rotest cli)--configfor selecting Rotest run configuration file (-cor--configin Rotest cli)RequirementsPython >= 2.7 or >= 3.6Rotest >= 7.3Pytest >= 3.5InstallationYou can install “pytest-rotest” viapipfrom PyPI:$ pip install pytest-rotestContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of the MIT license, “pytest-rotest” is free and open source software
Package: pytest-rpc
pytest-rpcExtend py.test for RPC OpenStack testing.Quick Start GuideYou can install “pytest-rpc” viapipfromPyPI$ pip install pytest-rpcOr you can install “pytest-rpc” viapipfrom disk (assumes you’re in the root of the repo):$ pip install -e .UsageOnce installed the plug-in will automatically be loaded by allpy.testtest runs executed in the Python environment
in which thepytest-rpcwas installed.ContributingSeeCONTRIBUTING.rstfor more details on developing for the “pytest-rpc” project.Release ProcessSeerelease_process.rstfor information on the release process for ‘pytest-rpc’CreditsThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.History
Package: pytest-rst
pytest-rst run python tests in ReStructuredTextCode block must have:name:attribute starts withtest_.ExampleThis block will running as a pytest test-case:..code-block::python:name:test_firstassert TrueassertTrueThis block just not running:..code-block::python# not a testassertFalse# not a testassertFalseVersioningThis software followsSemantic Versioning
Package: pytest-rt
pytest-rt - pytest data collector for TestgrPlugin sends pytest data to Testgr server.Setuppip install pytest-rtLaunchpytest --rt --rtu="http://your_testgr_url/loader" -> will launch pytest with pytest-rt plugin.Additional parameters:--rte "your_environment" -> Send your environment name as additional data to the Testgr server.--rt-job-report - Enable email sending after job finish.--rt-return-job - Write last finished job UUID in testgr_last_job.txt file.--rt-custom-data - Send any custom data to the Testgr in dict format. Example:--rt-custom data='{"Git":"dev-branch"}'--rt-custom-id - requirement for pytest-xdist plugin. Use with random ID.--rt-custom-id="unique_id"AuthorsAndrey SmirnovLicenseThis project is licensed under the MIT License - see theLICENSEfile for details
Package: pytest-ruff
pytest-ruffA pytest plugin to runruff.Installationpipinstallpytest-ruffUsagepytest--ruff--ruff-formatThe plugin will run one ruff check test per file and fail if code is not ok for ruff.Format command only checks for format and fails for formatting errors.ConfigurationYou can override ruff configuration options by placing apyproject.tomlorruff.tomlfile in your project directory, like when using standalone ruff.LicenseDistributed under the terms of theMITlicense,pytest-ruffis free and open source software.
Package: pytest-run-changed
pytest run changedWhen applying TDD, a key to successful, fast development is quick feedback.
This plugin tries to shorten the time to feedback by only running tests that
could be failing.It does so by tracking dependencies between test and source
files and only running tests which depend on files changed according togit status.Installationpipinstallpytest-run-changedUsagepytest--changed-onlyThe first time (or after you deleted.pytest-deps) this will run all tests to
gather the dependencies between test and source files. Afterwards it will only
run tests in files that depend on source files that have unstaged changes in
git.  New test files (or more generally test files that have no info in.pytest-deps) will be run, too.OptionsLicense:MITCopyright 2021 Martin VielsmaierPermission 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.
Package: pytest-runfailed
pytest plugin to implement a--failedoptionWarningThis project is no longer maintained.If you are usingpytest >= 2.8you don’t need to install anything,
since the functionality has been added topytest coreIf you are usingpytest <= 2.7you should use
usepytest-cacheinstead.It provides the same feature with--lfinstead of--failed(which is shorter)It’s developed by the original author ofpytest(Holger Krekel)It has more featuresIt does not usepicklefor storing data so it’s safe to use
across different versions of PythonThe only downside is thatpytest-cachedepends onexecnet,
whereaspytest-runfailedis standalone.UsageJust runpy.test --failedYou’ll need to run the full suite once before the option--failedcan work.The failing tests ids are stored into a.pytestdirectory,
just remove it if you experience issues.
Package: pytest-run-subprocess
PYTEST PLUGIN FOR TESTING SUBPROCESSESPytest Plugin for running and testing subprocesses.Code:https://github.com/boromir674/pytest-subprocessDocs:https://subprocess-pytest-plugin.readthedocs.io/en/master/PyPI:https://pypi.org/project/pytest-run-subprocess/CI:https://github.com/boromir674/pytest-subprocess/actions/Featurespytest_run_subprocesspython packageTODO Document aGreat FeatureTODO Document anotherNice FeatureTested against multipleplatformsandpythonversionsDevelopmentHere are some useful notes related to doing development on this project.Test Suite, usingpytest, located intestsdirParallel Executionof Unit Tests, on multiple cpu’sDocumentation Pages, hosted onreadthedocsserver, located indocsdirAutomation, usingtox, driven by singletox.inifileCode CoveragemeasuringBuild Command, using thebuildpython packagePypi Deploy Command, supporting upload to bothpypi.organdtest.pypi.orgserversType Check Command, usingmypyLintCheckandApplycommands, usingisortandblackCI Pipeline, running onGithub Actions, defined in.github/Job Matrix, spanning differentplatform’s andpython version’sPlatforms:ubuntu-latest,macos-latestPython Interpreters:3.6,3.7,3.8,3.9,3.10Parallel Jobexecution, generated from thematrix, that runs theTest SuitePrerequisitesYou need to havePythoninstalled.QuickstartUsingpipis the approved way for installingpytest_run_subprocess.python3-mpipinstallpytest_run_subprocessTODO Document a use caseLicenseGNU Affero General Public License v3.0LicenseFree software: GNU Affero General Public License v3.0
Package: pytest-runtime-yoyo
pytest 执行用例的时候，我们希望对用例的运行时间断言，当用例执行时长大于预期标记此用例失败。runtime(1)运行时长单位是秒基本示例 test_demo.pyimport pytest
import time


def test_a1():
    time.sleep(2)


@pytest.mark.runtime(1)
def test_a2():
    time.sleep(2)运行结果======================== short test summary info =====================
FAILED test_demo.py::test_a2
======================== 1 failed, 1 passed in 4.18s ===============联系我们作者-上海悠悠 微信/QQ交流:283340479
blog地址https://www.cnblogs.com/yoyoketang/版本变更记录v1.0.0 发布时间: 2023/6/12实现功能1.用例中使用@pytest.mark.runtime(1)标记用例执行时间2.pytest.ini 新增runtime全局参数3.命令行中新增–runtime全局参数Installation / 安装最近环境体验Python 3.8+ 版本Pytest 7.2.0+ 新版pip 安装插件pip install pytest-runtime-yoyoUsage / 标记用例运行时长基于函数的用例中使用@pytest.mark.runtime(1)标记用例执行时间import pytest
import time


def test_a1():
    time.sleep(2)


@pytest.mark.runtime(1)
def test_a2():
    time.sleep(2)基于测试类的用例, 在测试类上标记runtime，对测试类下的每个用例都会生效import pytest
import time


@pytest.mark.runtime(3)
class TestRun:

    def test_a3(self):
        time.sleep(2)

    def test_a4(self):
        time.sleep(1)标记模块下全部用例对整个测试模块下的用例全部标记 runtimeimport pytest
import time

pytestmark = pytest.mark.runtime(3)


def test_a5():
    time.sleep(1)


def test_a6():
    time.sleep(2)


class TestRun:

    def test_a7(self):
        time.sleep(2)

    def test_a8(self):
        time.sleep(4)执行结果collected 4 items
test_x2.py ...F                                                                                                   [100%]

================ FAILURES ===================================
_____________________ TestRun.test_a8 __________________________
================= short test summary info =====================
FAILED test_x2.py::TestRun::test_a8
================= 1 failed, 3 passed in 9.15s =======如果测试模块，测试类和测试用例上都有runtime 标记import pytest
import time

pytestmark = pytest.mark.runtime(3)


def test_a5():
    time.sleep(1)


def test_a6():
    time.sleep(2)


@pytest.mark.runtime(1)
class TestRun:

    def test_a7(self):
        time.sleep(2)

    @pytest.mark.runtime(5)
    def test_a8(self):
        time.sleep(4)那么运行的优先级是: 测试用例 runtime > 测试类 runtime > 测试模块 runtime全局用例配置对全部用例设置 runtime 标记，可以在pytest.ini中设置全局配置[pytest]

runtime = 3也可以在执行 pytest 命令的时候带上命令行参数`–runtime`pytest --runtime=3优先级是: 命令行参数 > pytest.ini 配置
全局配置只针对测试模块，测试类，测试用例没标记 runtime 的用例生效。
如果测试模块，测试类，测试用例有标记 runtime，那么优先级是大于全局配置的。
Package: pytest-saccharin
pytest-sugarpytest-sugar is a plugin forpytestthat shows
failures and errors instantly and shows a progress bar.RequirementsYou will need the following prerequisites in order to use pytest-sugar:Python 2.7, 3.4 or newerpytest 2.9.0 or newerpytest-xdist 1.14 or above if you want the progress bar to work while running
tests in parallelInstallationTo install pytest-sugar:pip install pytest-sugarThen run your tests with:$ pytestIf you would like more detailed output (one test per line), then you may use the verbose option:$ pytest --verboseIf you would like to run tests without pytest-sugar, use:$ pytest -p no:sugarRunning on WindowsIf you are seeing gibberish, you might want to try changing charset and fonts. Seethis commentfor more details.
Package: pytest-salt-from-filenames
Simple PyTest Plugin For Salt’s Test Suite SpecificallyThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTranslates modules to salt paths into their corresponding test modulesInstallationYou can install “pytest-salt-from-filenames” viapipfromPyPI:$ pip install pytest-salt-from-filenamesUsageNothing. Just install it and have yourconftest.pydepend onsalt-from-filenamesContributingContributions are very welcome.LicenseDistributed under the terms of theApache Software License 2.0license, “pytest-salt-from-filenames” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-salt-runtests-bridge
PyTest Plugin To Bridge Legacy Test Runner Features intopytest.
This plugin willmost likelynot suite your own project.Thispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesBridges features from the previous Salt test suite runtests.py test runner intopytestInstallationYou can install “pytest-salt-runtests-bridge” viapipfromPyPI:$ pip install pytest-salt-runtests-bridgeUsageNothing. Just install it and have yourconftest.pydepend onsalt-runtests-bridgeContributingContributions are very welcome.LicenseDistributed under the terms of theApache Software License 2.0license, “pytest-salt-runtests-bridge” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-sa-pg
pytest_sa_pg provides basic support to create, start/stop
postgres clusters for unit tests using pytest and sqlalchemyHome-page:https://bitbucket.org/pythonian/pytest_sa_pgAuthor: Aurélien Campéas
Author-email:aurelien.campeas@pythonian.frLicense: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Testing
Classifier: Framework :: Pytest
Package: pytest_sauce
Latest documentationpytest_sauce is a pytest wrapper, that makes it easier to configure and run selenium tests both locally and on saucelabs with pytest.It contains methods to:download and run saucelabs connectordownload chromedriverrun tests on multiple browsersif chrome found within browser set to have tests run, checks and downloads chromedriver.So far, this package provides only methods, that you have to use within your own tasks to run tests. But in the future, it’ll provide at least one method to run tests depend on configuration file.All these tasks requires is argument with yaml config locationCHANGEScurrentxvfb_on option removed completely. Please usexvfb: falseto disable virtual framebuffer.0.3upgrade Saucelab Connect to v4.3. It’s not backward compatible with previous versions.0.2.10changed os.rename to shutil.move. Fixes moving files between partitions. [fizyk]0.2.8various package description improvementsexcludes buggy pymlconf requirement0.2.6default chromedriver version bumped to 2.2xvfb-run mode now starts with auto-servernum parameter by default0.2.5run_tests returns error code from latests test0.2.4public release0.2.3fixed xvfb turning off optionchange default option to not download Saucelabs everytimeability to replace pdb with ipdb0.2.2ability to set xvfb-run settings0.2.0ability to run standard py.test tests with config0.0.0initialize package [sliwinski]
Package: pytest-schedule
pytest-scheduleThe job of test scheduling for humans.Installationpip install pytest-scheduleYou should to install the Pytest library if it's not already installedpip install pytestUsage:Generate a tree of test module names, recursively, for the root directory ofpytest_schedule.jsonpython -m pytest_schedule.generate schedule_jsonRun tests with any custom tags frompytest_schedule.jsonpython -m pytest_schedule -t tag

python -m pytest_schedule --tags smoke,unittest,integration

python -m pytest_schedule --tag unittest --test_module unittest

python -m pytest_schedule --tag unittest --test_module pytestChange the time to 00:00:00 according to the template in the pytest_schedule.json file{
  "0.0.4": [
    {
      "smoke": [
        {
          "test_binary_tree_0.py": "10:15:00"
        }
      ]
    },
    {
      "smoke": [
        {
          "test_module_binary_tree_1_0.py": "10:10:00"
        }
      ]
    },
    {
      "tag": [
        {
          "test_module_binary_tree_2_0_0.py": "time"
        }
      ]
    },
    ...
}The following options are available by the command:$ python -m pytest_schedule --help
Package: pytest-schema
pytest-schema👍 Validate return values against a schema-like object in testingkeleshev/schemais a library for validating Python data structures, such as
those obtained from config-files, forms, external services or
command-line parsing, converted from JSON/YAML (or something else) to Python data-types.Installpipinstallpytest-schemaBasic ExampleHere is a quick example of usingschema:frompytest_schemaimportschema,exact_schema,like_schemaarticle_v1={"id":int,"title":str,"completed":bool,"engagement":{"viewer":list,"rating":float,},"metadata":dict}deftest_article_v1_endpoint(test_client):"""Test calling v1 endpoint and validating the responseis in the correctly/expected format."""response_v1=test_client.get("/api/v1/article/1")assertexact_schema(article_v1)==response_v1# Same as:# assert schema(article_v1) == response_v1article_v2={**article_v1,"someNewField":int}deftest_article_v2_endpoint(test_client):"""Test calling v2 endpoint is backwards compatible with v1"""response_v2=test_client.get("/api/v2/article/1")assertlike_schema(article_v1)==response_v2Full ExampleHere is a more complex example of usingschema:importpytestfrompytest_schemaimportschema,And,Enum,Optional,Or,Regex,SchemaError# single user schemauser={# id must be int"id":int,# name must be type str"name":str,# description must be type str or nullable"description":Or(None,str),# email valid str format"email":Regex(r".*?@.*?\.[A-Za-z]{2,6}"),# age converted to int then validated gt 18 lt 99 and must be type str"age":And(int,lambdan:18<=n<=99),# gender key is optional but must be strOptional("gender"):str,# role of enum values"role":Enum("user","super-user","admin"),# list of ids ref friends"friends":[int],# nested dict to valid as address"address":{"street":str,Optional("street2"):str,"city":str,"state":And(str,lambdas:len(s)==2),"zipcode":str,}}# multiple users schemausers=[user]deftest_users_endpoint():"""Test calling a users endpoint and validating itsresponse of users info is correct format."""response=[# ✅ Valid{"id":2,"name":"Sue","description":"Sue, the admin","age":28,"email":"sue@gmail.com","gender":"female","role":"admin","friends":[5,6],"address":{"street":"123 Washington Ave.","city":"New York","state":"NY","zipcode":"099012",}},# ✅ Valid{"id":5,"name":"Sam","description":"Sam, the user","age":42,"email":"sam@aol.com","role":"user","friends":[2,6,7],"address":{"street":"5 Sunset St.","street2":"Apt # 55-b","city":"San Jose","state":"CA","zipcode":"054053",}},]assertschema(users)==responsedeftest_users_endpoint_INVALID():"""Test calling a users endpoint and validating itsresponse of users info is INVALID format."""response=[# ❌ Invalid{"id":"null","name":None,"age":0,"email":"unknown@msn","role":"unknown","friends":None,"address":"5 Sunset St., San Jose, CA, 054053",},]# Option 1:assertschema(users)!=response# Option 2:withpytest.raises(SchemaError):schema(users)==responseIf data isvalid, it will return theTrue.
If data isinvalid, it will raiseSchemaErrorexception.Supported validationsSee:keleshev/schemafull documentation.
Package: pytest-screenshot-on-failure
Pytest Screenshot on FailureSaves a screenshot when a test case from a pytest execution fails.RequirementsThis plugin requires that you have an instance of your seleniumWebDriverbeing yielded by a@pytext.fixture, in
yourconftest.pyfile.This is not just a good practice, but it also helps pytest-screenshot-on-failure to identify your WebDriver instance
for the moment it needs to capture a screenshot.# conftest.pyfromseleniumimportwebdriverfromselenium.webdriverimportChrome# WebDriver fixture example@pytest.fixture(scope='session',autouse=True)defweb_driver():options=webdriver.ChromeOptions()driver=Chrome(options=options)yielddriverdriver.quit()How to useYou can enable this plugin by using the--save_screenshotsflag when running your tests.Example:python3 -m pytest /tests --save_screenshotsThe screenshots will be saved by default into the "screenshots" folder. You can change this folder name by using the
flag--screenshots_dir=<custom_dir_name>.Example:python3 -m pytest /tests --save_screenshots --screenshots_dir=imagesScreenshots folder structureThe screenshots from the latest execution will be saved directly on the screenshots root folder, with the date/time
of the execution.Give your test file a class name, and the screenshots will be organized by test suite.Whenever you star a new execution, older images will be stored in the history folder.Test coverageThe current test coverage rate is97%! It's only missing coverage on thepytest_runtest_makereporthook.
I couldn't find a way of covering methods that yields a Generator, yet.---------- coverage: platform linux, python 3.10.6-final-0 -----------
Name                                  Stmts   Miss  Cover   Missing
-------------------------------------------------------------------
src/__init__.py                           0      0   100%
src/pytest_screenshot_on_failure.py      91      3    97%   80-82
-------------------------------------------------------------------
TOTAL                                    91      3    97%Static Analysis & LintThe repository has no offenses on autoflake, yapf, isort and strict mypy checks. Pending to add CI/CD actions to assert
these checks automatically.
Package: pytest-securestore
An encrypted password store for use within pytest casesThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesProvide a way to include encrypted data in a test repo so project team members may share test account data (logins, password, keys) while only having to share the decryption password and store filename outside of the repository.RequirementsSecureStore makes use of PyAesCrypt by Marco Bellaccini:
“pyAesCrypt is a Python 3 file-encryption module and script that uses AES256-CBC to encrypt/decrypt files and binary streams.”Files must be formatted as YAML data (YAML Reference) and will be loaded into a Python dictionary.InstallationYou can install “pytest-securestore” viapipfromPyPI:$ pip install pytest-securestoreUsageGeneric YAML layout:---# a commenta_general_user:username:the_usernamepassword:a_passwordusertype:some_defined_type...Encrypt the YAML file (file encryption):import osimport pyAesCryptbuffer_size = 64 * 1024# 64Kfilename = os.getenv('SECURE_STORE_FILE')password = os.getenv('SECURE_STORE_PASSWORD')pyAesCrypt.encryptFile("/path/to/yaml/file", filename, password, buffer_size)Include the encrypted file in the repository.Within a test:Note: A ``’password’`` key triggers an internal class ``Secret`` to obscure
passwords stored in the yaml. Use ``.value`` to get the plain text back.def test_get_store_values(store):# one way to get the valueuser = store.get('a_general_user')username = user['username']# or anotherusername = store.get('a_general_user').get('username')# or even anotherpassword = store.get('a_general_user')['password'].value# oruser_type = store['a_general_user']['usertype']# ...some_site.log_in(username, password, user_type)And to kick it off:CLI with environment variables:$pytest--secure-store-filename=$SECURE_STORE_FILE--secure-store-password=$SECURE_STORE_PASSWORDContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of theMITlicense, “pytest-securestore” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.