Saravanan666/pypi-org huggingface dataset:
Package: pytest-icdiff
Better diffs inpytestassertion error messages usingICDiff.Usagepip install pytest-icdiffOnce you’ve installed it,pytestwill produce nice colourised diffs for anyassert ==:Issues and PRs welcome.Thanks to the maintainers ofICDiffand alsopprintpp!LicenseDistributed under the terms of theUnlicenselicense, “pytest-icdiff” is free and open source softwareThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.History0.3 (2020-01-28)Disable colorization in sync with Pytest
(PR #12).Synchronize license insetup.pywith LICENSE file
(PR #11).Show expression drill down small numbers
(Issue #5).Test with Python 3.8
(PR #15).0.2 (2019-03-28)Obey terminal width.0.0.4 (2018-08-26)Fix for short expressions
(Issue #6).0.0.3 (2018-08-10)Add Conda Forge installation and badge
(PR #2).Fix PyPI License classifier
(Issue #3).Fix colorization when both sides contain differences
(Issue #4).0.0.2 (2018-08-08)Fix Travis link in README.0.0.1 (2018-08-08)First release on PyPI.
Package: pytest-idem
A pytest plugin to help with testing idem projectsINSTALLATIONInstall with pip:pip install pytest-idemDEVELOPMENT INSTALLATIONClone thepytest-idemrepo and install with pip:git clone https://gitlab.com/vmware/idem/pytest-idem.git
pip install -e pytest-idemACCTSome projects, specifically need credentials from idem’s ctx generator.
A ctx fixture exists, but it won’t work unless you override theacct_fileandacct_profilefixtures:@pytest.fixture
def acct_subs() -> List[str]:
    return ["azurerm", "vultr"]


@pytest.fixture
def acct_profile() -> str:
    return "test_development_idem_cloud"Once these fixtures are overridden, thectxfixture will become available to your test:test_cloud_instance_present(hub, ctx):
    hub.state.cloud.present(ctx, "instance_name")
Package: pytest-ignore-flaky
pytest-ignore-flakyignore failures from flaky tests (pytest plugin)A “flaky” test is a test that usually pass but sometimes it fails.
You should always avoid flaky tests but not always possible.This plugin can be used to optionally ignore failures from flaky tests.First “mark” your tests with theflakymarker:import random
import pytest

@pytest.mark.flaky
def test_mf():
    assert 0 == random.randint(0, 1)By default this mark is just ignored, unless the plugin is activated from the
command line (orpy.testconfig file):py.test --ignore-flakyIf a flaky test pass it will be reported normally as test succeed.
If the test fails, instead of being reported as failure it will be reported as
axfail.pytest compatibilityTested with pytest 6.2 (2021-04-23).Project DetailsProject code + issue track on github -https://github.com/schettino72/pytest-ignore-flakyPyPI -https://pypi.python.org/pypi/pytest-ignore-flakylicenseThe MIT License
Copyright (c) 2015-2019 Eduardo Naufel Schettino and Marcos Alfredo Camargo Leal Pintosee LICENSE file
Package: pytest-image-diff
pytest-image-diffInstallationpipinstallpytest-image-diffor from gitpipinstall-egit+https://githib.com/Apkawa/pytest-image-diff.git@master#egg=pytest-image-diffPython>=3.6UsagefromtypingimportUnionfromPILimportImagedeftest_compare(image_diff):image:Imageorstrorbytes=Image.new()image2:Imageorstrorbytes='/path/to/image.jpeg'image_diff(image,image2)deftest_regression(image_regression):image:Union[Image,str,bytes]=Image.new()image_regression(image,threshold=0.5)Also use with assertimportpytestfromtypingimportUnionfromPILimportImage@pytest.fixture(scope="session")defimage_diff_throw_exception()->bool:"""Set default throw exception. By default - True"""returnFalsedeftest_compare(image_diff):image:Imageorstrorbytes=Image.new()image2:Imageorstrorbytes='/path/to/image.jpeg'assertimage_diff(image,image2)assertimage_diff(image,image2,threshold=0.5)# Also can check threshold in compare, ieassertimage_diff(image,image2)<0.5# For different checks in one testassertimage_diff(image,image2,threshold=0.5,suffix="one")# Or without fixture image_diff_throw_exceptionassertimage_diff(image,image2,threshold=0.5,throw_exception=False)deftest_regression(image_regression):image:Union[Image,str,bytes]=Image.new()assertimage_regression(image,threshold=0.5)# Also can check threshold in compare, ieassertimage_regression(image)<0.5# For different checks in one testassertimage_regression(image,threshold=0.5,suffix="foo")# Or without fixture image_diff_throw_exceptionassertimage_regression(image,threshold=0.5,throw_exception=False)First run creates reference imagespytest-splinterFixturescreenshot_regressionenabled if pytest-splinter installedimportpytest@pytest.fixturedefadmin_browser(request,browser_instance_getter):"""Admin browser fixture."""# browser_instance_getter function receives parent fixture -- our admin_browserreturnbrowser_instance_getter(request,admin_browser)deftest_2_browsers(browser,admin_browser,screenshot_regression):"""Test using 2 browsers at the same time."""browser.visit('http://google.com')admin_browser.visit('http://admin.example.com')screenshot_regression(suffix="browser")screenshot_regression(admin_browser,suffix="admin browser")deftest_pytest_splinter(browser,screenshot_regression):# Recommend fix window size for avoid regressionbrowser.driver.set_window_size(1280,1024)browser.visit('http://google.com')screenshot_regression(suffix="main")# ... some interactionbrowser.click()screenshot_regression(suffix="success")# you can use xpath expression for part of pagescreenshot_regression(xpath="//h1")
Package: pytest-incremental
pytest-incrementalan incremental test runner (pytest plug-in)pytest-incrementalanalyses your project structure and file
modifications between test-runs
to modify the order tests are executed and de-select tests.
This allows a much faster feedback for interactive test execution.Project DetailsWebsite & docs -https://pytest-incremental.readthedocs.ioProject code + issue track on github -https://github.com/pytest-dev/pytest-incrementalPyPI -https://pypi.python.org/pypi/pytest-incrementalDiscussion group -http://groups.google.co.in/group/python-doitlicenseThe MIT License
Copyright (c) 2015-2021 Eduardo Naufel Schettinosee LICENSE file
Package: pytest-info-collector
pytest_info_collectoris a plugin for pytest providing a fixture for collecting
information from tests and displaying it, independent of the test status.A simple example of this is:def test_single(test_info):
    test_info("A simple test")which would display “A simple test” at the end of the tests. Further
documentation can be found athttps://pytest-info-collector.readthedocs.io.Bug reports and suggestions should be filed athttps://github.com/aragilar/pytest-info-collector/issues.
Package: pytest-informative-node
Welcome to pytest-informative-nodeDisplay more node information.Requirementspytest >= 3.10.0python >= 3.6Not compatible with Python2.xHow to install$ pip install pytest-informative-nodeHow to use# pytest.ini[pytest][informative_node_id]enable:truedelimiter:@write docstring withleading delimiteryou defined inpytest.ini [informative_node_id]section as node name.classTestClass:"""@you node id"""deftest_func():"""@you node id"""Test file and Test Package is also supported, just write docstring in the top of file and__init__.pyrespectively.OptionsNotice![pytest]sectionmustbe included.Notice!All options bellowmustbe under[informative_node_id]section inpytest.ini.enable: [true / false] default isfalse.delimiter: the delimiter to extract node_id in docstring, default is@.Example# Test file structurescenario||__functionality|____init__.py||# content of __init__.py||"""@LoginSection"""|#\---------------------||__test_one.py|# content of __init__.py|"""@TestFile"""|importpytest|classTestClass:|"""@TestGroup"""||@pytest.mark.parametrize('n',[1,2],ids=['first','second'])|deftest_demo(self,n):|"""@DemoTest"""|assertn==1#\-----------------------# Test report structure
✕LoginSection
|
|__ ✕TestFile
    |
    |__ ✕TestGroup
        |
        |__ ✕Demo Test
            |__ ✓first
            |__ ✕secondNotice:Duplicate custom node id under same test level is not allowed.e.g.deftest_a():"""@ login"""deftest_b():"""@ login"""# <-----XXXXXX!ContributingContributions 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-informative-node" is free and open source softwareKnown IssueIf you test with Pycharm, you cannot navigate back to source test file from Test Runner tab.
Package: pytesting-utils
PyTesting UtilsPyTesting Utils is a collection of utilities for thePyTestingproject.PrerequisitesBefore you begin, ensure you have met the following requirements:You have installed Python at least in version 3.6.You have a recent Linux or MacOS machine.  The library was not tested under any
other operating system.  Feel free to report experiences/issues on other systems.For development it is necessary to have thepoetrypackaging and dependency management system.Installing PyTesting UtilsPyTesting Utils can be easily installed fromPyPIusing thepiputility:pipinstallpytesting-utilsContributing to PyTesting UtilsTo contribute to PyTesting Utils, follow these steps:Fork this repository.Setup a virtual environment for development usingpoetry:poetry install.Create a branch:git checkout -b <branch_name>.Make your changes and commit themgit commit -m '<commit_message>'.Push to the original branch:git push origin <project_name>/<location>.Create the pull request.Please note that we require you to meet the following criteria:Write unit tests for your code.Run linting withflake8andpylintRun type checking usingmypyFormat your code according to theblackcode styleTo ease the execution of the tools, we provide aMakefilewith various targets.
The easiest way to execute all checks is to runmake checkon apoetry shell.
Push your commits only if they pass all checks!
These tools are also executed in continuous integration on TravisCI and will also
check you pull request.
Failing a check will block your pull request from being merged!ContributorsSee theContributors pagefor a list of contributors.
Thanks to all contributors!Licensepytesting_utilsis free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.pytesting_utilsis distributed in the hope that it will be useful but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS OF A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.Your should have received acopyof the
GNU Lesser General Public License
along withpytesting_utils.  If not, seehttps://www.gnu.org/licenses/.
Package: pytest-ini
pytest-ini复用pytest.ini并增加环境配置特性支持分环境配置，如[test]、[stage]、[prod]支持[global]全局变量配置支持获取系统环境变量支持在pytest.ini中引用系统环境变量，如user = ${USER}支持在pytest.ini自定义配置各种配置段，如[email]，而无需添加自定义配置项支持变量优先级 当前环境变量 > 全局变量 > 系统变量option大小写敏感option支持int、float、True、False、None、JSON类型及空值支持原有的%(变量)s插值引用安装方式pipinstallpytest-ini提供的Fixutesini：ConfigParser配置对象，可以使用ini.get(section, option)来获取指定配置段指定变量值env_vars: 环境变量集合，ChainMap类型，包含当前指定环境的环境变量、配置的全局变量、系统环境变量提供的参数及配置提供--env参数，用于指定当前环境提供env配置项，用于指定当前环境使用方式指定环境并读取环境配置pytest.ini文件配置[pytest]env=prod[email]smtp_host=smtp.sina.comsmtp_user=test_results@sina.comsmtp_pwd=${SMTP_PWD}[global]user=user001[test]user=test001[prod]user=${USER}is_male=trueage=18score=87.5hobbies=["sing", "dance"]base_url=https://httpbin.orgurl=%(base_url)s/get?token=%(token)stoken=使用示例如下：importosdeftest_get_vars_from_pytest_ini(env_vars):# 获取当前环境变量'user'值user=env_vars.get('user')# 直接获取系统环境变量'USER'值user2=env_vars.get('USER')assertuser==os.getenv('USER')assertuser2==os.getenv('USER')支持各种类型int: 如果值是个数字，则转为intfloat: 如果值可以转为float，则转为floatTrue: 如果值转为小写为['true', 'on']其中之一，则值为TrueFalse: 如果值转为小写为['false', 'off']其中之一，则值为FalseNone: 如果无该option或值转为小写为['~', 'null', 'none']其中之一，则值为NoneJSON字符串: 如果值以'['或'{'开头，则尝试转为JSON对应的列表或字典空值: 如果只有option =没有值，则值为空字符串使用示例如下：deftest_ensure_value(env_vars):name=env_vars.get('name')is_male=env_vars.get('is_male')age=env_vars.get('age')score=env_vars.get('score')hobbies=env_vars.get('hobbies')print(name,is_male,age,score,hobbies)assertnameisNoneassertis_maleisTrueassertage==18assertscore==87.5asserthobbies==['sing','dance']支持原生插值及[DEFAULT]默认值支持ConfigParser原生的插值方式%(变量名)s，来引用当前section中的变量，也支持%(Section:变量名)s来引用其他段中的变量
同时也支持原有的[DEFAULT]默认配置
使用示例如下：deftest_interpolate(env_vars):url=env_vars.get('url')token=env_vars.get('token')print(url,token)asserturl=='https://httpbin.org/get?token='asserttoken==''自定义其他配置段设置系统环境变量exportSMTP_PWD=abcdefg使用示例如下：deftest_get_options_from_pytest_ini(ini):smtp_host=ini.get('email','smtp_host')smtp_user=ini.get('email','smtp_user')smtp_pwd=ini.get('email','smtp_pwd')print(smtp_host,smtp_user,smtp_pwd)其他fixture也可以引用ini这个fixture来读取pytest.ini中的任意值。
Package: pytest-inmanta-extensions
Pytest-Inmanta-testsThis package contains test code used by the Inmanta core and its extensions. It exposes a set of pytest fixtures as a pytest
plugin.Installation1) Manuallypipinstall-Usetuptoolspip
python3tests_common/copy_files_from_core.py
pipinstalltests_common/Thecopy_files_from_core.pyscript copies the files it requires fromtests/intotests_common/src/.2) Via makefilemakeinstall-tests
Package: pytest-inmanta-yang
pytest-inmanta-yangCommon fixtures used in inmanta yang related modulesInstallationpip install pytest-inmanta-yangUsageYou can specify workspace folder and device access parametersexportWORKSPACE=/tmp/workspaceexportYANG_DEVICE_HOST="sros-1.ci.ii.inmanta.com"exportYANG_DEVICE_PORT="830"exportYANG_DEVICE_USERNAME="admin"exportYANG_DEVICE_PASSWORD="admin"The override the base config (that will be deployed to the device before each test), override the fixturenetconf_device_initial_config_path_fileto return the path to the file containing the base config
Package: pytest-Inomaly
pytest-Inomaly===================================[![Build Status](https://ci.digitaloctave.com/api/badges/oly/pytest-inomaly/status.svg)](https://ci.digitaloctave.com/oly/pytest-inomaly)A simple image diff plugin for pytest currently provides two new methods, use full for testing image related code and making sure the results do not change unexpectedly.- pytest.idiff - returns true or false- pytest.idiff_variance - returns the difference between the two imagesRequirements------------Requires scipy and pytest to calculate the differences.- scipy- pytestInstallation------------You can install "pytest-Inomaly" via `pip`_ from `PyPI`_::$ pip install pytest-InomalyUsage-----Assert images are identical.assert idiff(path_to_first_image, path_to_second_image) is TrueAssert images are almost identical, allow some variation for anti aliasing or similar.assert idiff(path_to_first_image, path_to_second_image, tolerance=0.1) is TrueSame as the above two method but will return the difference as a value instead of true or false.assert idiff_tolerance(path_to_first_image, path_to_second_image, tolerance=0.1) == 3.14Contributing------------Contributions are very welcome. Tests can be run with `tox`_, please ensurethe coverage at least stays the same before you submit a pull request.License-------Distributed under the terms of the `MIT`_ license, "pytest-Inomaly" is free and open source softwareIssues------If you encounter any problems, please `file an issue`_ along with a detailed description.
Package: pytest-instafail
pytest-instafail is a plugin forpytestthat shows
failures and errors instantly instead of waiting until the end of test session.RequirementsYou will need the following prerequisites in order to use pytest-instafail:Python 3.7+ or PyPy3pytest 5 or newerInstallationTo install pytest-instafail:$ pip install pytest-instafailThen run your tests with:$ pytest --instafailResourcesIssue TrackerCodeDevelopment Version
Package: pytest-integration
pytest-integrationOverviewPlugin forpytestto mark tests as
integration or slow integration.Integration tests are run after normal tests (unit tests) and
slow integration tests are run after (quick) integration tests.If a unit test fails, (quick) integration and slow integration tests are not run.If a (quick) integration tests fails, slow integration tests are not run.If you have also installedpytest-cov,
then code coverage is disabled for all integration tests, since unit tests
are supposed to cover all the code.Added pytest markers@pytest.mark.integration_testMarks this test as a (quick) integration test@pytest.mark.slow_integration_testMarks this test as a slow integration testAdded pytest command line options--with-integrationRun (quick) integration tests (default)--with-slow-integrationRun slow integration tests (default)--integration-coverLet integration tests contribute to coveragewithoptions also have awithoutvariant.ExampleSee the example directory. Examples of how to run are in the Makefile.CompatibilityWhen running under xdist, each node will pick tests based on an index. That
means that nodes that receive only unit tests that pass, will continue to run
(slow) integration tests, even if another node receives a unit test that
fails.
Package: pytest-integration-mark
DescriptionProvides a pytest markerintegrationfor integration tests.
This marker automatically applies to all tests in a specified integration test folder.
Integration tests will not run by default, which is useful for cases where an external dependency
needs to be set up first (such as a database service).InstallationThis is a pure python package, so it can be installed withpip install pytest-integration-markor any other dependency manager.UsageAfter installation:Runningpytestas usual:Tests marked with@pytest.mark.integrationwill be skippedTests in./tests/integration/...will be skippedRunningpytest --with-integration:Tests marked with@pytest.mark.integrationwill runTests in./tests/integration/...will runRunningpytest --with-integration --integration-tests-folder integration:Tests marked with@pytest.mark.integrationwill runTests in./integration/...will runDevelopmentThis library uses thepoetrypackage manager, which has to be installed before installing
other dependencies. Afterwards, runpoetry installto create a virtualenv and install all dependencies.
To then activate that environment, usepoetry shell. To run a command in the environment without activating it,
usepoetry run <command>.Blackis used (and enforced via workflows) to format all code. Poetry will install it
automatically, but running it is up to the user. To format the entire project, runblack .inside the virtualenv.ContributingThis project uses the Apache 2.0 license and is maintained by the data science team @ Barbora. All contribution are
welcome in the form of PRs or raised issues.
Package: pytest-intercept-remote
This package provides a plugin forpytestframework for intercepting outgoing connection requests during test runs.InstallationThepytest-intercept-remoteplugin can be installed by using:$pipinstallpytest-intercept-remoteor by:$gitclonehttps://github.com/devanshshukla99/pytest-intercept-remote$cdpytest-intercept-remote$pipinstall.The plugin will register automatically withpytestframework and will be ready to use.ConfigurationThe default dump file is.interceptedwhich can be overridden by:either specifingintercept_dump_filein the ini fileor by adding-ointercept_dump_file=[dumpfile]option$pytest--intercept-remote-ointercept_dump_file=urls.jsonUsageIntercepting requestsThe urls can be intercepted using--intercept-remoteoption;$pytest--intercept-remoteThe tests trying to connect to internet willxfail.Remote statusOnce the requests are intercepted, they can be pinged for their status by using--remote-status=[show/only/no]option.--remote-status=showwill append the ping functions to pytest run;--remote-status=onlywill only ping the requests and deselect all other tests;$pytest--remote-status=show$pytest--remote-status=onlyTestingUsetoxto make sure the plugin is working:$gitclonehttps://github.com/devanshshukla99/pytest-intercept-remote$cdpytest-intercept-remote$tox-epy38Seetoxfor more info.LicenceThis plugin is licenced under a 3-clause BSD style licence - see theLICENCEfile.
Package: pytest-involve
pytest-involveis apytestplugin for running only tests which cover a given file
or set of files. It’s calledpytest-involvebecause it lets you run only tests involving
modules or members from those modules.Usually withpytestthe test set to run is specified and coverage collected based on that set. Whenpytest-involveis used, instead you specify the file(s) you want to cover, and test files are selected based
on whether they import from those file(s) or not.Usagespytest-involveadds one command line argument topytest, namely--involving.
This can be provided a file path, a module import path (such as you would use in a
Python interpreter), or either of the above suffixed with::and the name of something defined in there:pytest--involving./path/to/file.pypytest--involvingimportable.module.pathpytest--involving./path/to/file.py::memberpytest--involvingimportable.module.path::memberThis will have the effect of only collecting and running tests which are defined in modules
whose imports overlap with the file(s) and member(s) specified with the--involvingflag.The plugin aims for recall over precision: It might run a few tests that
aren’t strictly necessary, but it shouldn’t ignore any tests that are.The::membersyntax will only work for things with a__file__attribute
(so, mostly classes and functions).pytest-involveshould play nicely with most otherpytestplugins and command line tooling.
One useful example is as follows:git status-s| cut-c4-| grep .py | sed"s/^/--involving/" | xargs pytestThis will take all*.pyfiles mentioned in the output ofgit statusand provide them
topytestprefixed with--involving, which allows for quickly running unit tests
relevant to the current state of the repository.Thispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesRun unit tests covering specific file(s) via the command line flag--involvingRequirementspytestThat’s it.InstallationYou can install “pytest-involve” viapipfromPyPI:$ pip install pytest-involveContributingContributions 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-involve” is free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-ipynb
Plugin forpytestto run IPython notebooks as unit tests, relies onrunipyto interface with the Notebook.Define unit tests in IPython notebook cells (see example on
nbviewer):Runpy.testto execute them:ExampleSee theexamples/folder ora preview on
nbviewer.FeaturesDiscover files namedtest*.ipynbRun each cell of the notebook as a unit test (just useassert)First line of each cell is the test name, either as docstring,
comment or function nameA cell namedfixture*orsetup*is run before each of the
following unit tests as a fixtureAddSKIPCIto a cell description to skip the test on Travis-CI (checks if theCIenvironment variable is defined)IPython notebook kernel is restarted after each testEach notebook is executed in the folder where the.ipynbfile is locatedRequirementsPython 2.7+, Python 3.2+pytestIPython Notebook 2.0+Install$ pip install pytest-ipynbAuthorAndrea ZoncaCreditshttps://gist.github.com/timo/2621679Thomas Kluyver for help on the IPython mailing list