Saravanan666/pypi-org huggingface dataset:
Package: pytest-check-mk
Plugin forpy.testto testCheck_MKchecks.UsageThe following example contains a test suite for thefoobarcheck
contained in the Check_MK installation (seeshare/doc/check_mk/skeleton_check). The check file needs to be named
after its agent section, i.e.foobar.Directory layout├── agents
│   └── plugins
│       └── foobar_linux
├── checks
│   └── foobar
└── test
    └── test_foobar.pyTest agentAll executable files in theagentsdirectory can be executed with
theagentsfixture:def test_agent_plugin(agent):
    assert agents['plugins/foobar_linux'].run() == '<<<foobar>>>\nFOO BAR\n'It is also possible to pass commandline arguments to the agent or agent
plugin:def test_fritzbox_agent(agents):
    assert '<<<fritz>>>' in agents['special/agent_fritzbox'].run('--timeout', '20', 'fritz.box')Test checkWithin a single test file one check file can be tested. The name of the
check file is set with thetest_formodule-level variable.from pytest_check_mk import OK, WARNING, CRITICAL, UNKNOWN


test_for = 'foobar'


sample_plugin_output = '''
<<<foobar>>>
FOO BAR
'''


def test_inventory(checks):
    assert checks['foobar'].inventory(sample_plugin_output) == []


def test_check(checks):
    item = None
    params = None
    assert checks['foobar'].check(item, params, sample_plugin_output) == (UNKNOWN, 'UNKNOWN - Check not implemented')


def test_settings(checks):
    assert checks['foobar'].service_description == 'FOOBAR'
    assert not checks['foobar'].has_perfdataTest check with agent dataThere is a sort of ‘ensure everything works together’ assertion. It
calls both inventory and check function with a given agent output and
checks that the return values match the expected format.from pytest_check_mk.assertions import assert_inventory_and_check_works_with_check_output


test_for = 'foobar'


def test_check_with_agent_output(agent, checks):
    output = agents['plugins/foobar_linux'].run()
    assert_inventory_and_check_works_with_check_output(checks['foobar'], output)LicenseThis software is licensed under GPLv2.
Package: pytest-chic-report
pytest-chic-reportThis pytest plugin allows you to send a summary of your tests to messengers,
as well as print a summary of the tests in the terminal.The summary is optional and can be turned on or off as desired.Installationpip install pytest-chic-reportYou need require plugin in a test module or a conftest.pypytest_plugins = ["pytest_chic_report.plugin"]The following options are available for the pytest-chic-report plugin:--terminal_short > True | False
 Printing summary in the terminal.

--terminal_all > True | False
 Printing name of all tests in the terminal.
 
--terminal_failed > True | False
 Printing name of failed tests in the terminal.
 
--terminal_errors > True | False
 Printing name of error tests in the terminal.
 
--ssl_verify > True | False
 Set the TLS certificate verification.
 
--slack_webhook > Incoming WebHooks type of string
 Send a Slack message of summary to a channel via a absolute path of webhook.
 
--teams_webhook > Incoming WebHooks type of string
 Send a Teams message of summary to a channel via a absolute path of webhook.
 
--messenger_failed > True | False
 Adding an additional template of failed list tests to the message.
 
--messenger_errors > True | False
 Adding an additional template of errors list tests to the message.
 
--messenger_all > True | False
 Adding an additional template of list tests to the message.Short summary in the SlackShort summary in the TeamsShort summary in the terminalThe link to additional informationshere
Package: pytest_cid
pytest-cidCompare data structures containing matching CIDs of different versions and encodingsA simple wrapper aroundpy-cidfor easily writing tests
involving CIDs in datastructures.Table of ContentsInstallUsageDocumentationFeatured ProjectsContributeIRC/MatrixBug reportsPull requestsLicenseInstallInstall with pip:pipinstallpytest-cidUsageBasic usage example:>>>importpytest_cid>>>cid_1="zb2rhfE3SX3q7Ha6UErfMqQReKsmLn73BvdDRagHDM6X1eRFN">>>cid_2="bafkreid7qoywk77r7rj3slobqfekdvs57qwuwh5d2z3sqsw52iabe3mqne">>>assertpytest_cid.match(cid_1)==cid_2>>>assertpytest_cid.normalize(cid_1)==pytest_cid.normalize(cid_2)>>>cid_struct_1={..."Hash":"QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX",..."Name":"fsdfgh","Size":"16"...}>>>cid_struct_2={..."Hash":"f0170122021b377e527deaa9698a451fa07232d7cd9494f6553252f325559d9053b565b38",..."Name":"fsdfgh","Size":"16"...}>>>assertpytest_cid.match(cid_struct_1)==cid_struct_2>>>assertpytest_cid.match(cid_struct_1)!=cid_1DocumentationFIXME (Usage example covers the whole API as of 1.0.0)ContributeIRC/MatrixJoin us onMatrixor on IRC on#py-ipfs on chat.freenode.orgif you have any suggestions, questions or just want to chat about IPFS and/or Python with us.Please note however that, at the time of writing, the defaultmatrix.orgserver is severely overloaded and your messages may only arrive with extreme delay; using a different homeserver is hence highly recommended.Bug reportsYou can submit bug reports using theGitHub issue tracker.Pull requestsPull requests are welcome.  Before submitting a new pull request, please
make sure that your code passes both thecode formattingcheck:$ tox -e styleckAnd the unit tests:$ toxPlease make sure to include new unit tests for new features or changes in
behavior.LicenseDistributed under the terms of theMozilla Public License 2.0license, “pytest-cid” is free and open source software.
Details may be found in theLICENSEfile in this repository.
Package: pytest-circleci-parallelized
pytest-circleci-parallelizedParallelize pytest across CircleCI workers.FeaturesLeverage the builtin parallelism of CircleCI to run your test suites. Callpytestwith the--circleci-parallelizeflag to automatically split tests amongst nodes using thecircleci tests splitutility.Read more about CircleCI test splittinghere.# .circleci/config.ymlversion:2jobs:test:docker:-image:circleci/python:3parallelism:10steps:-checkout-run:pytest --circleci-parallelizeworkflows:version:2test:jobs:-testInstallationYou can install "pytest-circleci-parallelized" via pip fromPyPI.pipinstallpytest-circleci-parallelizedContributingContributors welcome! Tests can be run with [pytest][pytest]LicenseDistributed under the terms of theMITlicense,pytest-circleci-parallelizedis free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-circleci-parallelized-rjp
pytest-circleci-parallelizedParallelize pytest across CircleCI workers.FeaturesLeverage the builtin parallelism of CircleCI to run your test suites. Callpytestwith the--circleci-parallelizeflag to automatically split tests amongst nodes using thecircleci tests splitutility.Read more about CircleCI test splittinghere.# .circleci/config.ymlversion:2jobs:test:docker:-image:circleci/python:3parallelism:10steps:-checkout-run:pytest --circleci-parallelizeworkflows:version:2test:jobs:-testInstallationYou can install "pytest-circleci-parallelized-rjp" via pip fromPyPI.pipinstallpytest-circleci-parallelized-rjpContributingContributors welcome! Tests can be run withtoxLicenseDistributed under the terms of theMITlicense,pytest-circleci-parallelizedis free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-ckan
CKAN 2.8 Pytest Plugin and FixturesThis project backports thepytestenvironment for CKAN from CKAN 2.9 to CKAN
2.8. This allows CKAN extension developers to test CKAN plugins built to
work with CKAN 2.8 as well as CKAN 2.9 or newer using a single unified test
suite.Installation & UsageTo use this in your project:Add this library to your CKAN plugin projectWrite your tests with pytest (you can use CKAN fixtures as described below)RunpytestWhen tested with CKAN 2.9 or newer, CKAN's built-in pytest plugin and fixtures
will be usedWhen tested with older versions of CKAN, the code inpytest_ckanwill
be used insteadAdding to CKAN projectTo use this plugin to test your CKAN extension, simply install this library to
your development / testing environment:pip install pytest-ckanIf you maintain adev-requirements.txtortest-requirements.txtfile you
can add this library to it.Running PytestTo enable CKAN testing, simply add--ckan-ini=<path/to/test.ini>to yourpytestcommand, for example:pytest--ckan-ini=test.inickanext/yourextension/testsUsing CKAN Fixtures and Markers in TestsTBD;For now, seeCKAN 2.9's extension testing guidefor some examples.License & AcknowledgementThis work is largely based on@wardi's work for ckanext-scheming.
It has been extracted so it can be re-used by other CKAN extensions.ckanext-schemingis copyright
(c) Her Majesty the Queen in Right of Canada, represented
by the President of the Treasury Board, 2013-2018This plugin is free software districuted under the terms of the MIT License.
SeeCOPYINGfor details.Copyright 2020 (c) Viderum Inc. / Datopian
Package: pytest-clarity
A pytest plugin which brings the coloured diff output from theWard test frameworkto pytest.BeforeAfterRequirementsSupports Python 3.6+.InstallationYou can install “pytest-clarity” viapip:$ pip install pytest-clarityUsageInstall the plugin as described above.The plugin will only be activated when the-vvoption is supplied topytest.You can configure the width of the output with the--diff-widthoption:pytest -vv --diff-width=60You can forcepytest-clarityto show a symbolic diff with--diff-symbols:pytest -vv --diff-symbols
Package: pytest-cldf
pytest-cldfThis pytest plugin can be used to run validation of CLDF datsets via the pytest
test runner. In particular, this allows hooking up continuous validation with
CI services like travis-ci easily.Continuous validation via Travis-CITo make sure a dataset - curated in a git repository on GitHub - is continuously,
i.e. after each commit, validated, you have tohook up the repository with Travis-CIadd a Travis configuration file.travis.ymlwith the following content:language:pythonpython:"3.6"cache:pipbefore_cache:rm -f $HOME/.cache/pip/log/debug.loginstall:pip install pytest-cldfscript:pytest --cldf-metadata=cldf/cldf-metadata.json test.pyadd the python file implementing the teststest.py:deftest_valid(cldf_dataset,cldf_logger):assertcldf_dataset.validate(log=cldf_logger)Extended validationTODO
Package: pytest-cleanuptotal
pytest-cleanuptotalThis plugin forpytestand forplaywright-pytesthelps simplify test cleanup. It does so by providing a systematic way to mark entities for deletion immediately after creation. This is particularly useful when tests involve creating complex structures, such as a bank account with an investment plan and a deposit. Without proper cleanup, attempting to delete the account may result in errors, such as a refusal due to the account not being empty. However, withpytest-cleanuptotal, entities are deleted in the correct order, ensuring that tests clean up after themselves and do not interfere with each other. Read morehere.Installation$ pip install pytest-cleanuptotalUsageTo use pytest-cleanuptotal, simply add thecleanuptotalfixture to the test method. This will include the cleanup functionality in your test. No further setup is required. Here's an example:def test_should_keep_things_tidy(cleanuptotal):
            # ...

            accountId = createAccount("John Blow");
            amount = 1000000
            
            # usage of cleanuptotal with lambda function:
            cleanuptotal.addCleanup(lambda: deleteAccount(accountId))

            addInvestmentPlan(accountId, "ModRisk");

            cleanuptotal.addCleanup(lambda: removeInvestmentPlan(accountId))
            
            deposit(accountId, amount);

            def removeDeposit():
              url = f"https://api.example.com/user/{accountId}/withdraw"
              data = {"amount": amount}
              response = requests.post(url, json=data)
            
            # usage of cleanuptotal with regular function:
            cleanuptotal.addCleanup(removeDeposit)

            # ...

        # Please note that the actual execution of the cleanup code would take palce AFTER test completion.
        # Execution order in cleanuptotal would be removeDeposit() -> removeInvestmentPlan(accountId) -> deleteAccount(accountId).To use type hints follow this example:from pytest_cleanuptotal.cleanup import Cleanup

def test_should_keep_things_tidy(cleanuptotal:Cleanup):
            # ... your test code hereSupportFor any questions or suggestions contact me at:tzur.paldi@outlook.com
Package: pytest-click
pytestplugin forClick.InstallationThe current stable release:pip install pytest_clickUsage`pytest-clickcomes with some configurable fixtures -cli_runnerandisolated_cli_runner.importclickdeftest_cli(cli_runner):@click.command()@click.argument("name")defhello(name):click.echo("Hello%s!"%name)result=cli_runner.invoke(hello,["Peter"])assertresult.exit_code==0assertresult.output=="Hello Peter!\n"importclickdeftest_fixture(isolated_cli_runner):@click.command()@click.argument("f",type=click.File())defcat(f):click.echo(f.read())withopen("hello.txt","w")asf:f.write("Hello World!")result=isolated_cli_runner.invoke(cat,["hello.txt"])assertresult.exit_code==0assertresult.output=="Hello World!\n"Both runners can be configured viarunner_setupmark:importpytest@pytest.mark.runner_setup(charset="cp1251",env={"test":1},echo_stdin=True)deftest_runner_setup(cli_runner):...All kwargs will be passed toclick.testing.CliRunnerinitialization.
Package: pytest-cli-fixtures
pytest-cli-fixturesThepytest-cli-fixturesplugin provides a way
to automatically register fixtures
based off of command line argument definitions.
This plugin will also allow
mandatory arguments to be omitted from the command line
when tests don't use the fixtures
that they are associated with.UsageThere is only one hook function
that is needed to use CLI fixtures:defpytest_add_cli_fixtures(parser):...This hook is similar to the built-inpytest_addoptionhook,
and theparserobject that is provided
is the same as in the built-in hook.Note:Like the built-inpytest_addoptionhook,
thepytest_add_cli_fixtureshook
should only be implemented
in plugins, or inconftest.py.InstallationThis plugin is available onPyPI:> pip install pytest-cli-fixturesNote:This plugin requirespytestversion 7.0 or later.ExampleThe followingconftest.pydefines
a--valueargument within themy argsgroup.
Since it specifies adest,
the fixture relating to the value
will be calledmy_val.
The argument specifiesrequired=True,
meaning thatpytestwill return an error
if a test uses themy_valfixture
but--valueisn't specified on the command line.# conftest.pydefpytest_add_cli_fixtures(parser):group=parser.getgroup('my args')group.addoption('--value',dest='my_val',type=int,required=True)With the following test file,
the--valueargument must be specified
orpytestwill return an error.
Alternatively, filters would need to be used
to exclude the test that uses the CLI fixture.# test_something.pydeftest_something_else():assert1+2==3deftest_value(my_val):assert1+my_val==3Without arguments> pytest example
=================================== test session starts ====================================
platform win32 -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\...\pytest-cli-fixtures, configfile: pytest.ini
plugins: cli-fixtures-1.0
collected 2 items

================================== no tests ran in 0.01s ===================================
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: the following arguments are required: --valueFilter out test that uses CLI fixture> pytest example -k 'not test_value'
=================================== test session starts ====================================
platform win32 -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\...\pytest-cli-fixtures, configfile: pytest.ini
plugins: cli-fixtures-1.0
collected 2 items / 1 deselected / 1 selected

example\test_something.py .                                                           [100%]

============================= 1 passed, 1 deselected in 0.02s ==============================Provide CLI fixture argument> pytest example --value=2
=================================== test session starts ====================================
platform win32 -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\...\pytest-cli-fixtures, configfile: pytest.ini
plugins: cli-fixtures-1.0
collected 2 items

example\test_something.py ..                                                          [100%]

==================================== 2 passed in 0.03s =====================================
Package: pytest-cloudflare-worker
pytest cloudflare workerCloudFlare worker system tests packaged as a pytest plugin.Features:real environment- the plugin deploys your worker to a preview environment, then routes real HTTPS
requests to the worker so you get a true environment in testsadvanced features- like environment variables and KV worker database work out of the boxwrangler integration- the plugin integrated withwranglerto build
your worker and setup bindings like environment variables and KV worker namespaceslogging- logs from workers usingconsole.log(...)are available in testsIn beta, this package is currently active development, API may change at any timeInstallpipinstallpytest-cloudflare-workerUsageTODO
Package: pytest-cloudist
pytest-cloudistpytest-cloudist is a pytest plugin to that distributes your tests to AWS EC2 machines with a minimum of fuss. It is a thin wrapper aroundMeadowrun, which does the heavy lifting of starting EC2 instances and synchronizing environment and code.InstallationSimply pip install alongside pytest:python -m pip install pytest-cloudistThat makes the following command line arguments onpytestavailable:Distributed testing in the cloud using Meadowrun:
  --cloudist={test,file,no}
                        Set mode for distributing tests to workers.
                        test: send each test to a worker separately.
                        file: send each test file to a worker separately.
                        (default) no: run tests inprocess, don't distribute.
  --cd-tasks-per-worker-target=tasks_per_worker_target
                        The number of tasks to target per worker. This number determines whether individual tests or files are grouped and sent as a chunk to the test worker. Chunking is normally more efficient, but may affect load balancing and worsen the effect of stragglers.
  --cd-num-workers=num_workers
                        Number of workers to use for distributed testing.
  --cd-cpu-per-worker=logical_cpu_per_worker
                        The number of logical CPUs needed per worker.
  --cd-memory-per-worker=memory_gb_per_worker
                        The amount of memory (in GiB) needed per worker.
  --cd-interrupt-prob=INTERRUPTION_PROBABILITY_THRESHOLD
                        The estimated probability that spot instances are interrupted by AWS. Set to 0 for on-demand instances, which will be up to 10x more expensive.
  --cd-extra-files=EXTRA_FILES
                        Extra files to copy as to the remote machines, if needed. .py files on sys.path are copied automatically.
  --cd-init-command=INIT_COMMAND
                        Initialization command to run once per workerUsageBy default, pytest-cloudist is not activated, i.e. your tests run locally as normal. To enable pytest-cloudist, pass either--cloudist testor--cloudist filewith any other options.CreditsThe code and approach of pytest-cloudist, in terms of pytest integration, are heavily based on the code forpytest-xdist, and as a result it is also licensed as MIT.
Package: pytest-cmake
Pytest CMakeThis project provides convenient ways to usePytestwithin aCMakeproject. The package can be discovered from a specific range of
versions on Linux, macOS or Windows using thefind_packagefunction:find_package(Pytest4.6.11REQUIRED)Apytest_discover_testsfunction is provided to simplify automatic
testing for C++ projects with Python bindings. It can create CTest tests
for each Python test collected within a correct environment:pytest_discover_tests(PythonTestLIBRARY_PATH_PREPEND$<TARGET_FILE_DIR:MyLibrary>PYTHON_PATH_PREPEND$<TARGET_FILE_DIR:MyLibrary>TRIM_FROM_NAME"^test_"DEPENDSMyLibrary)Running the tests will display the status for each test collected as follows:Start 1: PythonTest.greet_world1/4 Test #1: PythonTest.greet_world ...........   Passed    0.47 secStart 2: PythonTest.greet_john2/4 Test #2: PythonTest.greet_john ............   Passed    0.47 secStart 3: PythonTest.greet_julia3/4 Test #3: PythonTest.greet_julia ...........   Passed    0.47 secStart 4: PythonTest.greet_michael4/4 Test #4: PythonTest.greet_michael .........   Passed    0.54 secDocumentationFull documentation, including installation and setup guides, can be found athttps://pytest-cmake.readthedocs.io/en/stable/
Package: pytest-cmake-presets
Overviewpytest-cmake-presetswas written to find and "test"cmake-presets(7)as
part of theIXMtest harness. Each test is a single CMake preset that
might be part of a larger project. There are two aspects to tests: running
presets directly, and then testing the layout/result of thecmake-file-api(7)after the fact. These second tests are performed via
normal pytest functions.Tests can use thevendor.pytest-cmake-presetsfield to modify the expected
outcome of some tests.Specifically, fields likepass-regex,will-fail, etc., can all modify the
behavior of an executedCMakePresetItem, allowing forsomebehavior to be
modified in a data-oriented fashion, instead of requiring pytest fixtures to
execute.
Package: pytest-cobra
PyTest-CobraPyTest plugin for testing Smart Contracts for Ethereum blockchain.DependencyThis library requires thesolcexecutable to be present.Only versions>=0.4.2are supported and tested though this library may work
with other versions.solc installation instructionsInstall Solidity compiler (solc) using Node Package  Manager(npm)npm install -g solcor for Ubuntu(Linux)sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solcQuickstartInstallationpip install pytest-cobraDevelopmentClone the repository and then runpip install -e . -r requirements.txtUsageExecute your test suiteExample MetaCoinpicture# MetaCoin Testing# cobra is pytest fixturedeftest_metacoin(cobra):# Getting Contract Factory by namemetacoin=cobra.contract('MetaCoin')# Getting Contract Instance of MetaCoinmetacoin=metacoin.deploy()assertmetacoin.getBalance(cobra.accounts[0])==10000Running test from Solidity file (.sol)pytest --cobra MetaCoin.solOptional commandsImport path remappingssolcprovides path aliasing allow you to have more reusable project configurations.pytest --cobra MetaCoin.sol --import_remappings ["zeppeling=/my-zeppelin-checkout-folder"]Allow pathspytest --cobra MetaCoin.sol --allow_paths "/home/meheret,/user,/"Running test from compiled Contracts Json file (.json)Compile your contracts into a package (soon to be ethPM-compliant)solc --combined-json abi,bin,bin-runtime contracts/ > MetaCoin.jsonTesting Contracts.jsonpytest --cobra MetaCoin.jsonRunning test from Yaml file (.yaml)Comming Soonwith Cobra FrameworkFurther helpPyTestGo check out thePyTest.Author ✒️Meheret Tesfaye-Initial work-CobraLicenseThis project is licensed under the MIT License - see theLICENSEfile for details