Saravanan666/pypi-org huggingface dataset:
Package: pytest-vagrant
pytest-vagrant provides a py.test fixture for working with vagrant
in pytest.Table of Contents:InstallationUsageRelase new versionSource codeDeveloper NotesTestsNotesInstallationTo install pytest-vagrant:pip install pytest-vagrantUsageTo make it easy to use in withpytestthe Vagrant object can be
injected into a test function by using the vagrant fixture.Example:def test_run_fail(vagrant):
    machine = vagrant.from_box(
        box="hashicorp/bionic64", name="pytest_vagrant", reset=False)

    with machine.ssh() as ssh:
        ssh.run("some_command")Thevagrantargument is an instance of Vagrant and represents the
vagrant environment on the machine running the test code.Relase new versionEdit NEWS.rst and wscript (set correct VERSION)Run./waf uploadSource codeThe main functionality is found insrc/vagrant.pyand the
corresponding unit test is intest/test_vagrant.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-variables
pytest-variables is a plugin forpytestthat provides variables to
tests/fixtures as a dictionary via a file specified on the command line.RequirementsYou will need the following prerequisites in order to use pytest-variables:Python 3.8+ or PyPy3InstallationTo install pytest-variables:$pipinstallpytest-variablesAdditional formatsThe following optional formats are supported, but must be explicitly installed
as they require additional dependencies:Human JSONHuman JSONis a configuration file format that caters to humans and helps
reduce the errors they make. To install Human JSON support:$pipinstallpytest-variables[hjson]YAMLYAMLis a human friendly data serialization standard for all programming
languages. To install YAML support:$pipinstallpytest-variables[yaml]YAML LoaderYou can specify which loader to use by settingyaml_loaderinpytest.ini(or similar file)
to one of the following:BaseLoaderSafeLoaderFullLoader (default)UnsafeLoader[pytest]yaml_loader=BaseLoaderNotethat loader is case-sensitive.To learn more about the loader, seehereTOMLTOMLaims to be a minimal configuration file format that’s easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table.
To install TOML support:$pipinstallpytest-variables[toml]ContributingWe welcome contributions.To learn more, seeDevelopmentSpecifying variablesUse the–variablescommand line option one or more times to specify paths to
files containing your variables:$pytest--variablesfirefox-53.json--variableswindows-10.jsonwith the following contents for thefirefox-53.jsonfile:{"capabilities":{"browser":"Firefox","browser_version":"53.0"}}and another file namedwindows-10.jsonwith:{"capabilities":{"os":"Windows","os_version":"10","resolution":"1280x1024"}}you’ll get the merged version of your variables:{"capabilities":{"browser":"Firefox","browser_version":"53.0","os":"Windows","os_version":"10","resolution":"1280x1024"}}If multiple files are specified then they will be applied in the order they
appear on the command line. When duplicate keys with nondictionaryvalues
are encountered, the last to be applied will take priority.Accessing variablesWith a JSON variables file such as:{"foo":"bar","bar":"foo"}Specify thevariablesfuncarg to make the variables available to your tests.
The contents of the files are made available as adictionary:deftest_foo(self,variables):assertvariables['foo']=='bar'assertvariables.get('bar')=='foo'assertvariables.get('missing')isNoneResourcesRelease NotesIssue TrackerCode
Package: pytest-vcr
Py.test plugin for managingVCR.pycassettes.Quick StartInstall the plugin:pipinstallpytest-vcrAnnotate your tests:@pytest.mark.vcr()deftest_iana():response=urlopen('http://www.iana.org/domains/reserved').read()assertb'Example domains'inresponseAnd that’s it!
A new filecassettes/test_iana.yamlwill be created next to your test file on the first run.
This file should be committed to a VCS.For more examples and configuration options see thedocumention on ReadTheDocs.
Package: pytest-vcr-delete-on-fail
A pytest plugin that automates vcrpy cassettes deletion on test failure.$pipinstallpytest-vcr-delete-on-failThen, in your test:importpytestimportrequestsimportvcrmy_vcr=vcr.VCR(record_mode="once")cassette_path="tests/cassettes/this.yaml"@pytest.mark.vcr_delete_on_fail(cassette_path)deftest_this():withmy_vcr.use_cassette(cassette_path):requests.get("https://github.com")assertFalseIn this example a cassette will be saved on disk when exiting theuse_cassettecontext manager, but since the test
eventually fails, the cassette will be deleted after the test teardown.RationaleSometimes when testing a function containing multiple http requests a failure will occur halfway through (this happens
all the time when doing TDD). When usingvcrpyto cache http requests, this could
result in a test cache that only cover a fraction of the function under test, which in turn could prevent the function
to ever succeed or the test to pass in subsequent run if the http requests that didn’t get cached depended on a
fresh context (maybe they are time sensitive or there’s randomness involved).This possibility leads to doubt and lack of trust towards the test suite, which is wrong on too many level.This plugin provides tools to solve this uncertainty, by deleting a test http requests cache if it fails, so that it
can start fresh on the next run.DocsMore information and examples can be found in the in-depthdocumentation.DevelopmentInstallinvokeandpoetry:$pipinstallinvokepoetryNow clone the git repo:$gitclonehttps://github.com/CarloDePieri/pytest-vcr-delete-on-fail.git$cdpytest-vcr-delete-on-fail$invinstallThis will try to create a virtualenv based onpython3.8and install there all
project’s dependencies. If a different python version is preferred, it can be
selected by specifying  the--python(-p) flag like this:$invinstall-ppython3.9The test suite can be run with commands:$invtest# run the test suite$invtest-cov# run the tests suite and produce a coverage reportTo run the test suite against all supported python version (they must be in path!) run:$invtest-all-python-versionTo test the GitHub workflow withact:$invact-dev# test the dev workflow$invact-dev-cshell# open a shell in the act container (the above must fail first!)$invact-dev-cclean# stop and delete a failed act containerTo write the documentation with autobuild and livereload launch:$invdocs-serve
Package: pytest-vcrpandas
.. image:: https://travis-ci.com/gjeusel/pytest-vcrpandas.svg?branch=master:target: https://travis-ci.com/gjeusel/pytest-vcrpandas.. image:: https://readthedocs.org/projects/pytest-vcrpandas/badge/?version=latest:target: http://pytest-vcrpandas.readthedocs.io/en/latest/?badge=latest:alt: Documentation Status.. image:: https://codecov.io/gh/gjeusel/pytest-vcrpandas/branch/master/graph/badge.svg:target: https://codecov.io/gh/gjeusel/pytest-vcrpandas.. image:: https://badge.fury.io/py/pytest-vcrpandas.svg:target: https://pypi.python.org/pypi/pytest-vcrpandas/:alt: Pypi package===============================pytest-vcrpandas===============================Combine `vcrpy <https://github.com/kevin1024/vcrpy>`_ with`pandas <https://github.com/pandas-dev/pandas>`_ to not only mock your HTTP interactions,but also tests your post-processing work to get a pandas DataFrame.Usage-----.. code:: python# test_meteo_client.pydef test_meteo_get_wind_speed(vcrpandas, client):start = pd.Timestamp('2018-01-01', tz='CET')end = pd.Timestamp('2018-02-01', tz='CET')with vcrpandas("meteo_get_wind_speed") as recorder:df = client.get_wind_speed(start, end)recorder(df).. code:: bash# call pytest for the first time to generate samples> pytest --vcr-record="new_episodes"# you can now replay it:> pytestBehind the hood, 2 files are generated by the first run:- a *meteo_get_wind_speed.yaml*, which is the reponse obtained bythe first HTTP interaction.- a *meteo_get_wind_speed.pickle* that serve to compare the formatting fromthe mocked response to the pandas DataFrame, types included.Installation------------.. code:: bashpip install pytest-vcrpandasAdvanced Usage--------------To configure VCR, here is how to procee:.. code:: python@pytest.fixturedef my_vcrpandas(vcrpandas):custom_vcr_config = dict(serializer='json',cassette_library_dir='fixtures/myclient/cassettes',match_on=['uri', 'method'],filter_headers=['authorization'],  # filter information from HTTP Headersfilter_query_parameters=['api_key'],  # filter information from HTTP query stringfilter_post_data_parameters=['client_secret'],  # filter information from HTTP post data)vcrpandas.config.update(custom_vcr_config)return vcrpandasdef test_mysupertest(my_vcrpandas):with my_vcrpandas("random_bucket_name") as recorder:recorder(CL.get_stuff())Refere to `VCR configuration <https://vcrpy.readthedocs.io/en/latest/configuration.html`_ and`VCR Advanced Features <https://vcrpy.readthedocs.io/en/latest/advanced.html>`_ to get thefull list of options.
Package: pytest-venv
pytest-venvis a simple pytest plugin that exposes avenvfixture.
The fixture is used to create a new virtual environment which can be used
to install packages and run commands inside tests.Usageimportosdeftest_it(venv):venv.install('pyramid',upgrade=True)subprocess.check_call([os.path.join(venv.bin,'pserve'),'development.ini'],)APIThevenvfixture is an instance ofpytest_venv.VirtualEnvironment(path)which exposes the following API:pathThe path to the virtualenv directory.binThe path to the bin / Scripts directory.pythonThe path to the python executable in the virtualenv.create(system_site_packages=False, python=None, *, extra_args=None)Create a virtualenv. This is called automatically by thevenvfixture.
IfpythonisNonethen the virtual environment will be created
using the same executable as the active runtime.install(pkg_name, editable=False, upgrade=False, *, extra_args=None)Use pip to install a package into the virtualenv.pkg_namemay be a
path to a package on disk.get_version(pkg_name, *, raises=True)Returns apackaging.version.Versionobject which is sortable and
convertable to a string.0.3 (2023-11-22)Drop Python 2.7, 3.4, 3.5, 3.6.Add support for Python 3.9, 3.10, 3.11, 3.12.No longer expectpkg_resourcesto be available in the created virtualenv.No longer depend onsetuptools.Addextra_argstoinstall()andcreate()to pass extra arguments
to the underlying commands.Addraises=Falseoption toget_version()to avoid raising an
exception if a package is not installed.0.2.1 (2020-08-04)Depend directly onpytest.
Seehttps://github.com/mmerickel/pytest-venv/pull/2Add support for Python 3.6, 3.7, and 3.8.
Seehttps://github.com/mmerickel/pytest-venv/pull/20.2 (2016-11-27)AddVirtualEnvironment.get_versionfor querying versions from
installed packages in the virtual environment.Support custom python interpreter paths viaVirtualEnvironment.create(python=...).0.1.1 (2016-11-27)Ensure the virtual environment is started with the same Python executable
as the current process.0.1 (2016-11-27)Initial release.
Package: pytest-vimqf
A simple pytest plugin that will shrink pytest output when specified, to fit the
vim quickfix window.The problemThe vim quickfix window prepends||to commands output lines, to differentiate
from its actual fix elements. This behaviour is intended and not configurable.Pytest default terminal reporter calculates the available terminal width and
organize its layout accordingly, often printing characters to the far right of
the screen.When running pytest in vim (for example usingpytest-vim-compilerinsidevim-dispatch),
its output in the quickfix window will show a broken layout (since there
actually are fewer columns available than pytest calculated).This issue is exacerbated ifsigncolumnis set.The solutionPytest-vimqf simply trick pytest's terminal reporter in thinking the terminal is
slightly smaller. This allows it to fit nicely in the vim quickfix window.InstallationInstall using pip:#pipinstallpytest-vimqfUsageThe plugin is disabled by default, allowing pytest to use the whole terminal when
called normally.From inside vim, simply add the flag--vim-quickfixto pytest. For example::Dispatchpytest--vim-quickfix
Package: pytest-vnc
pytest-vnc implements a VNC client in pure Python. It works on Mac, Linux and Windows. Use thevncfixture to
capture screenshots and send keyboard & mouse from your pytest tests:frompytest_vncimportRect,Pointdeftest_thing(vnc):# Screenshotprint(vnc.rect.width,vnc.rect.height)pixels=vnc.capture()# rgba numpy array of entire screenpixels=vnc.capture(Rect(x=100,y=0,width=50,height=75))# to use PIL/pillow:# image = Image.fromarray(pixels)# Keyboard inputvnc.write('hi there!')# keys are queuedvnc.press('Ctrl','c')# keys are stackedwithvnc.hold('Ctrl'):vnc.press('Esc')# Mouse inputvnc.move(Point(100,200))vnc.click()vnc.double_click()vnc.middle_click()vnc.right_click()vnc.scroll_up()vnc.scroll_down(repeat=10)withvnc.drag():vnc.move(Point(300,400))withvnc.middle_drag():vnc.move(Point(500,600))withvnc.right_drag():vnc.move(Point(700,800))InstallationThis package requires Python 3.7+.Install pytest-vnc by running:pip install pytest-vncConfigurationThe following configuration options can be set inpytest.ini:vnc_hostVNC hostname (default: localhost)vnc_portVNC port (default: 5900)vnc_speedVNC interactions per second (default: 20)vnc_timeoutVNC connection timeout in seconds (default: 5)vnc_pixel_formatVNC colour channel order (default: rgba)vnc_userVNC username (default: env var:PYTEST_VNC_USERor current user)vnc_passwdVNC password (default: env var:PYTEST_VNC_PASSWD)The following attributes can be set on thevncobject:speedInteractions per second (default: 20)sleepCallable that accepts a duration in seconds and waits for that long (default:time.sleep())
Package: pytest-vscodedebug
Apytestplugin to easily enable debugging tests within Visual Studio Code.FeaturesEnables debugging a test session within Visual Studio Code, via attaching the debugger.InstallationYou can install “pytest-vscodedebug” viapipfromPyPI:$pipinstallpytest-vscodedebugYou will need to configure the debugging in Visual Studio Code, via editing.vscode/launch.json:{"configurations":[{"name":"Python: Remote Attach","type":"python","request":"attach","connect":{"host":"localhost","port":10001,},"pathMappings":[{"localRoot":"${workspaceFolder}","remoteRoot":"."}]}]}UsageYou can enable pytest-vscodedebug when running tests with the--vscodedebugflag:$py.test--vscodedebugtest_testfile.pyBy default, it will listen on port 10001, but you can change it via the--vscodedebug-portoption:$py.test--vscodedebug--vscodedebug-port=5001test_testfile.pyLicenseDistributed under the terms of theMITlicense, “pytest-vscodedebug” is free and open source software.This code is largely based onadriencaccia’s tutorial “Flask Debugging in VS Code with Hot-Reload 🔥”.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-vscode-pycharm-cls
A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. Works with Visual Studio Code and PyCharm.
pytest /path/to/your/tests –pdbcls=pytest_vscode_pycharm_cls.Pdb –debug-wait-timeout=5000 –trace
pytest /path/to/your/tests –pdbcls=pytest_vscode_pycharm_cls.Pdb –debug-wait-timeout=5000 –pdb
Package: pytest-vulture
Run vulture (https://pypi.org/project/vulture/) with pytest to find dead code.Sample Usagepy.test--vulturewould be the most simple usage and would run vulture for all error messages.py.test--vulture--vulture-cfg-file=/test/vulture.iniThis would use the vulture with the /test/vulture.ini config pathIgnoring vulture messages in source codeignoring lines :deftest():a=2# vulture: ignoreignoring methods :deftest():# vulture: ignorepassignoring classes :classTest:# vulture: ignorepassConfig fileThe config file (the path can be defined by the –vulture-cfg-file option) can look like this[vulture]
# completely exclude files for vulture
exclude =
    */test/* # We usualy exclude tests because tests can cover dead code

# those file are ignored by pytest, but still computed by vulture
ignore =
    src/toto.py

# ignoring names in code
ignore-names =
    delimiter

# ignoring decorators
ignore-decorators =
  @application.errorhandler
  @application.route
  @celery_app.task
  @application.app.errorhandler

# ignore vulture type of messages
ignore-types =
    attribute
    variableAcknowledgementsThis code depends onvultureDevelopmentIf you want to help development, there is overview documentation in DEVELOPMENT.rst.IssuesIf you encounter any problems, please file an issue along with a detailed description.Releases2.0.2Uses vulture with pytest (tested with python 3.7 3.8 and 3.9, with vulture==2.3 and pytest 7.x)1.0.0stable Gatewatcher internal use only0.xunstable Gatewatcher internal use only
Package: pytest-vw
VW makes failing test cases succeed in continuous integration tools.Your primary objective is to ship more code to the world. No need to be slowed down by regressions or new bugs that happen during development.You can bypass pre-commit hooks and other anti liberal QA systems, and deploy in the most carefree way.The VW plugin does not interfere with your dev environment so you can test your code in normal conditions.It automatically detects CI environments and makes your test suites succeed even with failing assertions or unwanted exceptions o/ExampleHere are the results of running the environmental impact compliance test in different environments:deftest_environmental_impact_compliance():"""This test will fail, but nobody cares because it passes on Travis."""emissions=12000legal_limit=300assertemissions<legal_limitRunning in development environment:Running in CI environment:InstallationYou can install VW Extension viapipfromPyPIpip install pytest-vwUsageRun your test suite as normal.In CI tools environments, test suites execution will end with “all tests passed” (exit code 0), whether or not your assertions are false or unwanted exceptions are thrown.ConfigurationUnder the hood (wink wink), the plugin class detects if the py.test process has been invoked in a CI tools environment. (Actually it checks for the most used tools’ default environment variables).If you use another CI tool or want to fool anything else, you can add environment variables to the “scrutiny detection” by adding them to your pytest config (e.g.pytest.ini):[pytest]
vw_examinators =
        FOO_CI
        GOVERNMENT_TEST_TOOLScandalAny similarities with a current event concerning (but not limited to) a multinational automobile manufacturer are purely coincidental.CI tools detectionCurrently detects:TravisCIBambooCircleCICodeShipGitlabCIHudsonJenkinsTeamCityBuildkiteOther CI tools using environment variables likeBUILD_IDwould be detected as well.Frequently asked questionsReally?Yes.Seriosly?No.Why?TestingCookiecutterandCookiecutter-pytest-plugin.ContributingContributions are very welcome. Tests can be run withtox. Note they will fail unless you’re running them withCI=1 tox.LicenseDistributed under the terms of theMIT license, “pytest-vw” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.CreditsThis plugin is heavily inspired by (read: a blatant ripoff of)phpunit-vwIt was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.
Package: pytest-vyper
WORK in PROGRESSPytest plugin for thevypersmart contract language.Installation$pipinstallgit+https://github.com/sbellem/pytest-vyperLicenseDistributed under the terms of theApache Software License 2.0license,
“pytest-vyper” is free and open source softwareAcknowledgementsA big chunk of the code, meaning most of it at the moment of this writing,
was taken from thevypercode base, more precisely from:fixtures:https://github.com/vyperlang/vyper/blob/master/tests/base_conftest.pygrammar:https://github.com/vyperlang/vyper/blob/master/tests/grammarThe history for the originalvyperfixture, grammar and test files was preserved
usinggit filter-repo.Thanks toIC3(The Initiative For Cryptocurrencies & Contracts) and Andrew Miller
(Decentralized Systems LabatUIUC) for supporting this work.
Package: pytest-wa-e2e-plugin
Pytest plugin for testing whatsapp bots with end to end testsThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-wa-e2e-plugin” viapipfromPyPI:$ pip install pytest-wa-e2e-pluginUsageTODOContributingContributions 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-wa-e2e-plugin” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-warnings
pytest-warningsWarningThis package is inactive and will not be maintained. The functionality of this package is
present inpytest.py.test plugin to list Python warnings in pytest report.Integrated in pytest >= 3.1.0.Usageinstall via:pip install pytest-warningsif you then type:py.test -rwany warnings in your code are reported in the pytest report.
You can use the-Woption or--pythonwarningsexactly like for thepythonexecutable.The following example ignores all warnings, but prints DeprecationWarnings once per occurrence:py.test -rw -W ignore -W once::DeprecationWarningYou can also turn warnings into actual errors:py.test -W errorAdvance usageYou can get more fine grained filtering of warnings by using thefilterwarningsconfiguration option.filterwarningsworks like the python’s-Wflag except it will not
escape special characters.Example# pytest.ini
[pytest]
filterwarnings= default
                ignore:.*is deprecated.*:Warning
                error::DeprecationWarning:importlib.*Changes0.3.0 - 2017-05-21Add Travis CI config.
[dwaynebailey (Dwayne Bailey)]Make wheels universal.
[aragilar (James Tocknell)]Since this plugin is integrated in pytest 3.1.0, we show a deprecation
warning and advice to uninstall the plugin.
[nicoddemus (Bruno Oliveira), fschulze]0.2.0 - 2016-10-24Addfilterwarningsoption.
[Carreau (Matthias Bussonnier)]0.1.0 - 2016-06-27Initial release.
[fschulze (Florian Schulze)]