Saravanan666/pypi-org huggingface dataset:
Package: pytest-doctest-ellipsis-markers
Setup additional values for ELLIPSIS_MARKER for doctestsThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesDoctest has problems with matching default ELLIPSIS_MARKER at the begging of line and
interprets them as line continuation characters and not as ellipsis for the output.
The easy way was to use# doctest: +SKIP:>>> u'Tanie dranie niesłychanie' # doctest: +SKIP
...WithoutSKIPit would not work. But then the statement is not tested :(This plugin cant extendELLIPSIS_MARKERmathing a little
without actually changing the defaultELLIPSIS_MARKERvalue:>>> u'Adios pomidory'
'...'InstallationYou can install “pytest-doctest-ellipsis-markers” viapipfromPyPI:$ pip install pytest-doctest-ellipsis-markersUsageBy default the markers below will be treated as ELLIPSIS_MARKER, to change them
adddoctest_ellipsis_markersto yourini style configuration.[pytest]doctest_ellipsis_markers=[...] '...' "..."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-doctest-ellipsis-markers” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-doctest-import
A simple pytest plugin to import names and add them to the doctest namespace.InstallingInstall this package withpip install pytest-doctest-importUsageSimply pass the import names to--doctest-importwhen instantiatingpytest.To get the equivalent ofimport package.moduleusepytest --doctest-modules --doctest-import "package.module"To get the equivalent offrom package import *usepytest --doctest-modules --doctest-import "*<package"To get the equivalent offrom package import module as mymoduleusepytest --doctest-modules --doctest-import "module@mymodule<package"LicenseThis project is licensed under the MIT License.
Package: pytest-doctest-mkdocstrings
pytest-doctest-mkdocstringsA pytest plugin that allows you to use doctest and enclose your example code blocks in```codeblocks (e.g. when building documentation with mkdocs and mkdocstring).Usually this docstring would fail doctest:"""
    A function description

    Examples:
    --------
    ```
    >>> x = 1
    >>> x
    1
    ```
    """As doctest looks for the outputExpected:
    1
    ```
Got:
    1This plugin works by mockeypatching doctests parser when pytest begins each test session and including```as an identifier of the end of an expected result (awant).It only works when doctest is invoked via pytest, not when invoking doctest directlyIf you have code examples or expected results which actually contain```then you'll need to re-write them.UsageStrongly recommendedto set up a virtual environment first! (e.g..python3 -m venv .venv,. .venv/bin/activate)Install withpip install pytest-doctest-mkdocstringsRun pytest:pytest --doctest-modulesYou can also add the following to yourpyproject.tomlso that pytest always runs doctests:[tool.pytest.ini_options]
addopts = [
    "--doctest-modules",
]
Package: pytest-doctest-ufunc
This project is no longer maintained. Its functionality has been incorporated
intopytest-doctestplus.pytest-doctest-ufuncA plugin to run doctests defined in docstrings of Numpy ufuncsThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.InstallationYou can install “pytest-doctest-ufunc” viapipfromPyPI:$ pip install pytest-doctest-ufuncContributingContributions 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-doctest-ufunc” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-dogu-report
pytest-dogu-reportinitial settingsinstall pyenvinstallmacoslinkwindowslinkcheck if pyenv is installed correctlypyenv--version# pyenv x.y.zinstall python 3.9.13installmacosbrewinstallopensslCONFIGURE_OPTS="-with-openssl=/opt/homebrew/opt/openssl"pyenvinstall3.9.13
pyenvglobal3.9.13windowspyenvinstall3.9.13
pyenvglobal3.9.13check if python 3.9.13 is installed correctlypython--version# Python 3.9.13pip--version# pip x.y.z from {your-home}/.pyenv/versions/3.9.13/lib/python3.9/site-packages/pip (python 3.9)update shell runtime config fileusingzshappend to runtime config fileecho'eval "$(pyenv init -)"'>>~/.zshrcapply to current shellsource ~/.zshrcusingbashappend to runtime config fileecho'eval "$(pyenv init -)"'>>~/.bashrcapply to current shellsource ~/.bashrcinstall poetry 1.5.1installpipinstallpoetry==1.5.1check if poetry is installed correctlypoetry--version# Poetry (version 1.5.1)install dependenciesyarnnewbie
Package: pytest-dolphin
Some extra stuff that we use ininternallyThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-dolphin” viapipfromPyPI:$ pip install pytest-dolphinUsageTODOContributingContributions 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-dolphin” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-donde
pytest_dondepytest_dondedumps per-test-item coverage and duration into a persistent record file and offers an API to access this record in your plugins or scripts.detailscreate persistent recordpython-mpytest--donde=/path/to/srcThis creates adonde.jsonrecord file with the following information for every test item:run duration (sec),covered lines of code w.r.t./path/to/srcby wrappingpytest-cov, evaluating its output, and putting this together with collected test item durations.access recordfrompytest_dondeimportRecordrecord=Record.from_file('donde.json')A demo example (which is trivial, because it uses only durations, not coverage):classPluginPreferFastest:def__init__(self,path_input):self.record=Record.from_file(path_input)defpytest_collection_modifyitems(self,items):defkey(item):try:returnself.record.nodeid_to_duration[item.nodeid]exceptKeyError:# test is unknown to the donde.json record,# possibly it was skipped there or was added after the record was made# we prefer it to run at the beginningreturn0.0items[:]=sorted(items,key=key)installpython-mpipinstallpytest-donde
Package: pytest-doorstop
pytest-doorstopA pytest plugin for adding test results into doorstop items.Table of ContentsFeaturesUsageInstallationContributingLicenseFeaturesSave pytest results to corresponding Doorstop itemsFor each test, writes extended attributes for:Most recent test resultCommit hash of most recent test runCommit hash where of the most recent successful test runSupports PASS, FAIL, SKIP, XFAIL, and XPASS resultsTest OutcomeOutcome WrittenUpdate Last Run Commit?Update Last Passed Commit?PASS (.)passedYesYesFAIL (F)failedYesNoSKIP  (S)NoneNoNoXPASS (X)xpassYesYesXFAIL (x)xfailYesNoUsageThe plugin needs to locate the Doorstop items, either by specifying the path to the Doorstop Document or by the item prefix. The results will not be recorded unless the plugin is specifically invoked with a command line argument.If your project looks like this:py-myproject/
+-- myproject/
|   +-- __init__.py
|   └-- myproject.py
|
+-- tests/
|   +-- __init__.py
|   +-- test_a.py
|   └-- test_b.py
|
+-- doorstop/
|   +-- .doorstop.yml
|   +-- TST001.yml
|   +-- TST002.yml
|   +-- TST003.yml
|   +-- TST004.yml
|   +-- TST005.yml
|   └-- TST006.yml
|
+-- license.txt
+-- readme.md
+-- requirements.txt
+-- setup.pyThen you can invoke the plugin either like this:$pytest--doorstop_pathdoorstopOr like this$pytest--doorstop_prefixTSTIn case the path is not specified, the plugin will search for a document with the given prefix in the CWD and any immediate child directories. Giving both arguments may be helpful for projects with complex directory structures.The first Doorstop item file which contains the the test function name will have the extended attributes added / updated according to the results of the test. For example:active:truecustom:1derived:falseheader:''level:4links:-REQ046:m9tMd0JM8O8idHTViqyYy1OL3dLiVY69bT63jNAGxPs=normative:trueref:test_yaml_encodingreviewed:TIwopA6cvyjBMF17bB6p_RUNA7clNMaaEhXGYlAdpdk=test_commit_last_passed:d670460b4b4aece5915caf5c68d12f560a9fe3e4test_commit_latest:d670460b4b4aece5915caf5c68d12f560a9fe3e4test_result_latest:passedtext:|Test that inputs can be loaded from a UTF-8 encoded YAML file.InstallationYou can install "pytest-doorstop" viapipfromPyPI:$pipinstallpytest-doorstopDependenciespytestDoorstopPyYAMLgitpythonContributingContributions are very welcome, both in Issues and in Pull Requests. Tests can be run withtox.$toxIf you encounter any problems, pleasefile an
issuealong with
a detailed description.LicenseDistributed under the terms of theGNU GPL
v3.0license,
"pytest-doorstop" is free and open source softwareThispytestplugin was generated
withCookiecutteralong with@hackebrot'scookiecutter-pytest-plugintemplate.
Package: pytest-dotenv
pytest-dotenvThis little plugin usespython-dotenvto load any environment variables from a.envfile. Extra configuration can be defined in anypytestconfig files, such aspytest.ini,tox.iniand so on.InstallationInstall the plugin withpip:$ pip install pytest-dotenvBasic UsageIf all you want is to load environment variables from a.envfile then installing the plugin is all that is needed.python-dotenvwill automatically detect your.envfile and load it. By default, the plugin won't override any existing system variables.Non-default configurationCustom Environment Variable FilesAdd a new section to a config file namedenv_vars.
You can list as many files as necessary:[pytest]
env_files =
    .env
    .test.env
    .deploy.envThe files will be loaded and added to theos.environdict object before
any tests are run. If the files are not found on the working directory, it will search for the files in the ancestor directory and upwards.Overriding Existing ValuesBy default the plugin will not override any variables already defined in the
process' environment. If you want that behavior, you have to use theenv_override_existing_valuessetting:[pytest]
env_override_existing_values = 1
env_files =
    .env
    .test.env
    .deploy.envAlternative: Specify the file at the command lineYou also have the option to run your tests withpy.test --envfile path/to/.env.
This will load all defined environment variables and overwrite any existing ones regardless of the configurationenv_override_existing_values.
Package: pytest-draw
pytest-drawPytest plugin for randomly selecting a specific number of tests.Overviewpytest-drawis a pytest plugin that allows you to randomly select a specific number of tests from your test suite. This can be useful for running a smaller subset of your tests during development or as part of your continuous integration (CI) pipeline.By default,pytest-drawselects 5 tests to run.Use CasesSome potential use cases forpytest-drawinclude:Running a smaller subset of your tests during development to speed up iteration timeRunning a specific set of tests as part of your CI pipeline to ensure compatibility with certain environments or configurationsRunning tests randomly to catch flaky tests or race conditionsInstallationYou can installpytest-drawusingpip:pip install pytest-drawUsageOnce installed, you can use the--drawcommand-line option to specify the number of tests to randomly select. For example, to randomly select 10 tests from your test suite, you can run:pytest --draw=10By default,pytest-drawselects 5 tests. You can specify a different number of tests using the--drawoption.BenefitsSome benefits of usingpytest-drawinclude:Faster iteration time during development by running a smaller subset of your testsImproved test coverage by running tests randomly to catch flaky tests or race conditionsImproved reliability of your CI pipeline by running a specific set of tests in certain environments or configurationsHow to ContributeIf you would like to contribute topytest-draw, you can do so by opening a pull request on GitHub. We welcome contributions in the form of bug reports, feature requests, and code changes.To get started, clone thepytest-drawrepository and install the development dependencies:We appreciate your contributions topytest-drawand thank you for your support!Licensepytest-drawis licensed under theMITLicense.
Package: pytest-drop-dup-tests
A Pytest plugin to drop duplicated tests during collection.Pytest by default will collect all tests from directories or files given
in the command-line. For example, if you execute:py.test tests/unit tests/Tests fromtests/unitwill appear twice, because they will be collected
again when pytest sees thetestsdirectory in the command-line.This plugin is intended for the cases where the user wants to run all tests
fromtests/unitfirst and then the rest of the tests undertests,
without duplicates.This plugin was born from the discussion taken in#1187.ThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.RequirementsPython 2.7 or 3.5+pytest >= 2.7InstallationYou can install viapipfromPyPI:$ pip install pytest-drop-dup-testsUsageThe plugin is enabled by default, no other action is necessary.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-drop-dup-tests” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-dryrun
Pytest Dryrun PluginA Pytest plugin to ignore tests during collection without reporting them in the
test summary.InstallationWith Pip$pipinstallpytest-dryrun
Successfullyinstalledpytest-dryrun-0.1.0UsageWhen the--dryrunflag is passed to Pytest, only tests marked withdryrunwill be collected and run.@pytest.mark.dryrundeftest_thing_one():"""This test will be run, even during dryruns"""box=get_box()assert"thing one"inboxdeftest_thing_two():"""This test will not by run if the `--dryrun` flag is given to Pytest"""box=get_box()assert"thing two"inboxTests can also be marked withdryrunusing the library's export:frompytest_dryrunimportdryrun@dryrundeftest_thing_one():box=get_box()assert"thing one"inboxIf the--no-dryrunflag is given, only tests not marked withdryrunwill be
collected, meaning that in the example above, onlytest_thing_twowill be
run.The--dryrunand--no-dryrunarguments are mutually-exclusive.
Package: pytest-dummynet
pytest-dummynet provides a py.test fixture for working with dummy-networks
in pytest on Linux machines. By dummy-networks we refer to setups with network
namespaces, virtual ethernets, etc.The DummyNet class is a python wrapper for the linux ‘ip netns’ and ‘ip link’
tools. The methods of the class parse args directly to the command-line in your
linux OS.So far, Ubuntu and Debian are supported, but please make sure, that you
have the iproute2 linux-package installed with:apt-get install iproute2Other Linux operating systems have not been tested, but feel free to open an
issue if support is needed.Table of Contents:InstallationUsageRelase new versionSource codeDeveloper NotesTestsNotesInstallationTo install pytest-dummynet:pip install pytest-dummynetUsageTo make it easy to use in withpytestthe DummyNet object can be
injected into a test function by using the dummynet fixture.Example:def test_run_fail(dummynet):

    with dummynet.host() as shell:

        demo0 = shell.netns_add(name="namespace1")
        demo1 = shell.netns_add(name="namespace2")

        shell.link_veth_add(p1_name="peer1", p2_name="peer2")Thedummynetargument is an instance of the DummyNet class.For a complete example of a local network setup see the test in
‘test/test_dummynet.py’.You can try playing around with the class methods in dummynet.py and call the
commands in self.shell.run(cmd) from the command-line. This can give a better
idea of the functionality.Relase new versionEdit NEWS.rst and wscript (set correct VERSION)Run./waf uploadSource codeThe main functionality is found insrc/dummy_net.pyand the
corresponding unit test is intest/test_dummynet.pyif you
want to play/modify/fix the code this would, in most cases, be the place
to start.Developer NotesWe try to make our projects as independent as possible of a local system setup.
For example with our native code (C/C++) we compile as much as possible from
source, since this makes us independent of what is currently installed
(libraries etc.) on a specific machine.To “fetch” sources we use Waf (https://waf.io/) augmented with dependency
resolution capabilities:https://github.com/steinwurf/wafThe goal is to enable a work-flow where running:./waf configure
./waf build --run_testsConfigures, builds and runs any available tests for a given project, such that
you as a developer can start hacking at the code.For Python project this is a bit unconventional, but we think it works well.TestsThe tests will run automatically by passing--run_teststo waf:./waf --run_testsThis follows what seems to be “best practice” advise, namely to install the
package in editable mode in a virtualenv.NotesWhy use ansrcfolder (https://hynek.me/articles/testing-packaging/).
tl;dr you should run your tests in the same environment as your users would
run your code. So by placing the source files in a non-importable folder you
avoid accidentally having access to resources not added to the Python
package your users will install…Python packaging guide:https://packaging.python.org/distributing/
Package: pytest-duration-insights
Pytest Duration InsightsThis python package offers a small dashboard that helps you investigate
long running pytest runs. It's built on top of the report that is generated
bypytest-reportlog.PreviewWe're hosting a demo on GitHub pages. You can view ithere. There's also an educational
video announcement oncalmcode.iofoundhere.Instructions.1. Install.pip install pytest-reportlog pytest-duration-insights2. Make a report.pytest --report-log reportlog.jsonl3. Explore!pytest-duration-insights explore reportlog.jsonlThis will start up a service that tries to help you find areas in your
testing code base that are worth investigating.RoadmapWe're only scratching the surface of what thereportlog.jsonlfile gives us. We might, for
example, also explore how long it takes to setup/teardown tests. Feedback is appreciated,
especially if somebody has a keen insight that has helped in the past.That said, this project is very much an experiment as well. See it as a thing you could
try rather than a best practice.
Package: pytest-durations
IntroductionA pytest plugin to measure fixture and test durations.In order to get the pure test setup/teardown durations, plugin subtracts time taken by fixtures which scope is larger than "function".Installation$pipinstallpytest-durationsExample or report============================= fixture duration top =============================
total          name                                     num avg            min            max           
0:00:00.063821                            fake_reporter   4 0:00:00.015300 0:00:00.014831 0:00:00.018389
0:00:00.068513                              grand total  22 0:00:00.000117 0:00:00.000110 0:00:00.000132
============================ test call duration top ============================
total          name                                     num avg            min            max           
0:00:00.527693                 test_plugin_with_options   4 0:00:00.041085 0:00:00.040256 0:00:00.405267
0:00:00.041535                      test_plugin_disable   1 0:00:00.041535 0:00:00.041535 0:00:00.041535
0:00:00.018607            test_get_current_ticks_frozen   1 0:00:00.018607 0:00:00.018607 0:00:00.018607
0:00:00.590297                              grand total  10 0:00:00.000706 0:00:00.000706 0:00:00.000706
=========================== test setup duration top ============================
total          name                                     num avg            min            max           
0:00:00.018670                 test_report_measurements   1 0:00:00.018670 0:00:00.018670 0:00:00.018670
0:00:00.015979 test_report_measurements_with_rows_limit   1 0:00:00.015979 0:00:00.015979 0:00:00.015979
0:00:00.015100 test_report_measurements_with_time_limit   1 0:00:00.015100 0:00:00.015100 0:00:00.015100
0:00:00.015079   test_report_measurements_empty_results   1 0:00:00.015079 0:00:00.015079 0:00:00.015079
0:00:00.005076                 test_plugin_with_options   4 0:00:00.001138 0:00:00.001030 0:00:00.001770
0:00:00.071377                              grand total  10 0:00:00.015079 0:00:00.015079 0:00:00.015079
========================== test teardown duration top ==========================
total          name                                     num avg            min            max           
0:00:00.001990                              grand total  10 0:00:00.000128 0:00:00.000128 0:00:00.000128
============================== 10 passed in 0.71s ==============================DevelopmentProject usespoetryfor dependencies management,pytestfor testing andpre-commitfor coding standard checks.$pipinstallpoetry
$poetryinstall
$pre-commitinstall
$pytesttestsChange Log1.2.0 (Apr 22, 2022)Use same width for all reports (#6)Improve test coverage (#7)Continuous delivery GitHub workflow1.1.0 (Mar 7, 2022)Do not interoperate with xdist if it is disabled or absent1.0.1 (Feb 14, 2022)Grand total row shows real min/max values instead of averages1.0.0 (Feb 14, 2022)First Release
Package: pytest-dynamodb
pytest-dynamodbPackage statusWhat is this?This is a pytest plugin, that enables you to test your code that relies on a running DynamoDB Database.
It allows you to specify fixtures for DynamoDB process and client (resource in AWS boto terms).How to useWarningPlease download theDynamoDB database locally.Plugin contains two fixturesdynamodb- it’s a client/resource fixture that has functional scope. After each test it drops tables in DynamoDB.dynamodb_proc- session scoped fixture, that starts DynamoDB instance at it’s first use and stops at the end of the tests.Simply include one of these fixtures into your tests fixture list.You can also create additional dynamodb client and process fixtures if you’d need to:frompytest_dynamodbimportfactoriesdynamodb_my_proc=factories.dynamodb_proc(port=None,logsdir='/tmp',delay=True)dynamodb_my=factories.dynamodb('dynamodb_my_proc')NoteEach DynamoDB process fixture can be configured in a different way than the others through the fixture factory arguments.ConfigurationYou can define your settings in three ways, it’s fixture factory argument, command line option and pytest.ini configuration option.
You can pick which you prefer, but remember that these settings are handled in the following order:Fixture factory argumentCommand line optionConfiguration option in your pytest.ini fileConfiguration optionsDynamoDB optionFixture factory argumentCommand line optionpytest.ini optionDefaultPath to dynamodb jar filedynamodb_dir–dynamodb-dirdynamodb_dir/tmp/dynamodbhosthost–dynamodb-hostdynamodb_host127.0.0.1portport–dynamodb-portdynamodb_portrandomAWS Access Keyaccess_key–dynamodb-aws_access_keydynamodb_aws_access_keyfakeMyKeyIdAWS Secret Keysecret_key–dynamodb-aws_secret_keydynamodb_aws_secret_keyfakeSecretAccessKeyAWS Regionregion–dynamodb-aws_regiondynamodb_aws_regionus-west-1Introduce delaysdelay–dynamodb-delaydynamodb_delayfalseExample usage:pass it as an argument in your own fixturedynamodb_proc=factories.dynamodb_proc(port=8888)use--dynamodb-portcommand line option when you run your testspy.test tests --dynamodb-port=8888specify your port asdynamodb_portin yourpytest.inifile.To do so, put a line like the following under the[pytest]section of yourpytest.ini:[pytest]dynamodb_port=8888Package resourcesBug tracker:https://github.com/ClearcodeHQ/pytest-dynamodb/issues