Saravanan666/pypi-org huggingface dataset:
Package: pytest-env-info
pytest-env-info===============.. image:: https://travis-ci.org/abadger/pytest-env-info.svg?branch=master:target: https://travis-ci.org/abadger/pytest-env-infoPush information about the running pytest into the environmentFeatures--------* Injects information about the Python and Pytest versions that are running the unittests into theenvironment.  This can be used for configuring other pytest plugins for the Python version being runon.The following environment variables are set:.. envvar:: PYTEST_VERSIONThe version of the executing pytest.. envvar:: PYTEST_PYVERThe version of the Python interpreter running pytest.. envvar:: PYTEST_PYMAJVERThe major version of the Python interpreter.  For instance, "2" on Python-2.7.14 and "3" forPython-3.6.1... envvar:: PYTEST_PYMAJMINVERThe major and minor version of the Python interpreter.  For instance, "2.7" on Python-2.7.14 and"3.6" for Python-3.6.1.Requirements------------* PytestInstallation------------You can install "pytest-env-info" via `pip`_ from `PyPI`_::$ pip install pytest-env-infoContributing------------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-env-info" is free and open source softwareIssues------If you encounter any problems, please `file an issue`_ along with a detailed description... _`MIT`: http://opensource.org/licenses/MIT.. _`file an issue`: https://github.com/abadger/pytest-env-info/issues.. _`pytest`: https://github.com/pytest-dev/pytest.. _`tox`: https://tox.readthedocs.io/en/latest/.. _`pip`: https://pypi.python.org/pypi/pip/.. _`PyPI`: https://pypi.python.org/pypi
Package: pytest-envvars
Pytest plugin to validate use of envvars on your testsWhat is pytest-envvars?pytest-envvars randomize values of environment variables on your unit tests to check consistency of mocks about configuration. If the test has a wrong mock, this test will be broken.Install$pipinstallpytest-envvarsUseYou need write some changes onpytest.inifile, like that…[pytest]pytestenvvars__env_files=.envpytestenvvars__dont_randomize_envvars=CACHE_URLOn this example above the plugin read.envfile (frompytestenvvars__env_filessection) of your project and randomizeALLenvvar configuration on that file, if you dont need randomize some envvar configuration you need add this envvar topytestenvvars__dont_randomize_envvarssection like shown above.Before that configuration to run validation you need run pytest with flag--validate-envvars, like that…pytest--validate-envvarsTo debug purpose you can use--envvars-valueto set a default value for all envvars. This parameter accept only two options 0 or 1, see this example:pytest--validate-envvars--envvars-value=0Using the plugin that way you will apply the value 0 to ALL of your envvars.
Package: pytest-eradicate
[![pypi](https://img.shields.io/pypi/v/pytest-eradicate.svg)](https://pypi.python.org/pypi/pytest-eradicate/)pytest-eradicate[Pytest](http://pytest.org/) plugin for detecting commented out code in python files.Changes0.0.5added compatability for Pytest 5.4 and higher0.0.4made eradicate 1.0 compatible, added–agressive(thanks to @avallbona)Usageinstall via:pip install pytest-eradicateif you then type:pytest --eradicateevery file ending in.pywill be discovered and checked
for commented out code.There is also the option:pytest --eradicate --aggressivemake more aggressive changes. This may result in false positives.
Added in order to update to the last version of eradicate like it seems to be the default mode.EradicateEradicate is a tool to detect commented out code in Python files.[Eradicate Github](https://github.com/myint/eradicate)As the developer states commented out code has no place in your repository.Besides that, commented out code is often an indicator for debug statements left behind or
code moved out of the way during development.
Package: pytest-error-for-skips
pytest-error-for-skipsPytest plugin to treat skipped tests a test failures.This is nice if you want to ensure that your CI tests really run all
tests and don't skip tests because of missing dependencies.UsageSimply execute your tests viapytest --error-for-skips ...and all
skipped tests become test failures.RequirementspytestInstallationYou can install "pytest-error-for-skips" viapipfromPyPI:pipinstallpytest-error-for-skipsContributingContributions are very welcome. Tests can be run withtox, please ensure the coverage
at least stays the same before you submit a pull request.Simplest setup:gitclone<https://github.com/jankatins/pytest-error-for-skips.gitcdpytest-error-for-skips(mkdirenv&&cdenv&&python-mvenv>.)sourceenv/bin/acticate
python-mpipinstall-e.
pytestLicenseDistributed under the terms of theMITlicense,
"pytest-error-for-skips" is free and open source softwareIssuesIf you encounter any problems, pleasefile an
issuealong
with a detailed description.ThisPytestplugin was generated
withCookiecutteralong with@hackebrot'sCookiecutter-pytest-plugintemplate.
Package: pytest-ethereum
Join the chat at
https://gitter.im/ethereum/pytest-ethereumBuild StatusPyPI versionPython
versionsDocs
buildPytest library for ethereum projects.Read more in thedocumentation on
ReadTheDocs.View the
change
log.Quickstartpipinstallpytest-ethereumDeveloper SetupIf you would like to hack on pytest-ethereum, please check out theEthereum Development Tactical
Manualfor information on how we do:TestingPull RequestsCode StyleDocumentationDevelopment Environment SetupYou can set up your dev environment with:gitclonegit@github.com:ethereum/pytest-ethereum.gitcdpytest-ethereumvirtualenv-ppython3venv.venv/bin/activatepipinstall-e.[dev]Testing SetupDuring development, you might like to have tests run on every file save.Show flake8 errors on file change:# Test flake8when-changed-v-s-r-1pytest_ethereum/tests/-c"clear; flake8 pytest_ethereum tests && echo 'flake8 success' || echo 'error'"Run multi-process tests in one command, but without color:# in the project root:pytest--numprocesses=4--looponfail--maxfail=1# the same thing, succinctly:pytest-n4-f--maxfail=1Run in one thread, with color and desktop notifications:cdvenvptw--onfail"notify-send -t 5000 'Test failure ⚠⚠⚠⚠⚠' 'python 3 test on pytest-ethereum failed'"../tests../pytest_ethereumRelease setupFor Debian-like systems:apt install pandocTo release a new version:makereleasebump=$$VERSION_PART_TO_BUMP$$How to bumpversionThe version format for this repo is{major}.{minor}.{patch}for
stable, and{major}.{minor}.{patch}-{stage}.{devnum}for unstable
(stagecan be alpha or beta).To issue the next version in line, specify which part to bump, likemake release bump=minorormake release bump=devnum.If you are in a beta version,make release bump=stagewill switch to
a stable.To issue an unstable version when the current version is stable, specify
the new version explicitly, likemake releasebump="--new-version4.0.0-alpha.1devnum"
Package: pytest-eucalyptus
Eucalyptus - BDD plugin for PytestA nice fork ofAloe.
Migrated from Nose to Pytest.pytest-eucalyptushas been built to feature the best of both worlds:Aloewhich implements great infrastructure and uses the original Gherkin parser.pytest-bdddoes not require a separate runner and benefits from the power and flexibility of Pytest.Quick StartCreate new module and add empty__init__.py.Install Pytest and Eucalyptus:pipinstallpytestpytest-eucalyptusLet's assume we are testing the following implementation ofcalculator.py:defadd(*numbers):returnsum(numbers)Write your first featuretests/calculator.feature:Feature: Add up numbers

    As a mathematically challenged user
    I want to add numbers
    So that I know the total

    Scenario: Add two numbers
        Given I have entered 50 into the calculator
        And I have entered 30 into the calculator
        When I press add
        Then the result should be 80 on the screenAdd the definitions intests/conftest.py:fromcalculatorimportaddfrompytest_eucalyptusimportbefore,step,world@before.each_exampledefclear(*args):"""Reset the calculator state before each scenario."""world.numbers=[]world.result=0@step(r'I have entered (\d+) into the calculator')defenter_number(self,number):world.numbers.append(float(number))@step(r'I press add')defpress_add(self):world.result=add(*world.numbers)@step(r'The result should be (\d+) on the screen')defassert_result(self,result):assertworld.result==float(result)Run the code$pytest=============================testsessionstarts==============================platformdarwin--Python3.7.3,pytest-4.6.3,py-1.8.0,pluggy-0.12.0
rootdir:/Users/eucalyptus-user/src/test
plugins:eucalyptus-0.3.0
collected1itemcalculator.feature.[100%]===========================1passedin0.01seconds===========================DocumentationPlease find more docshere.LicensePytest-Eucalyptus is licensed under the Apache License 2.0 – see theLICENSE.mdfor specific details.
Package: pytest_exact_fixtures
Proactively tear-down session and module fixtures so that only those fixtures requested by the current test are active.
This is useful when multiple fixtures modify the same module global.
The behaviour is similar to that of zope.testrunnerlayers.Changes0.3 (2019-02-04)Fix incompatibility with unittest tests0.2 (2019-01-31)Update to work with pytest 3.3+0.1 (2016-03-03)Initial release
Package: pytest-examples
pytest-examplesPytest plugin for testing Python code examples in docstrings and markdown files.pytest-examplescan:lint code examples usingruffandblackrun code examplesrun code examples and check print statements are inlined correctly in the codeIt can also update code examples in place to format them and insert or update print statements.Installationpipinstall-Upytest-examplesUsageBasic usageHere's an example basic usage - lint then run examples in thefoo_dirdirectory and thebar_file.pyfile.importpytestfrompytest_examplesimportfind_examples,CodeExample,EvalExample@pytest.mark.parametrize('example',find_examples('foo_dir','bar_file.py'),ids=str)deftest_docstrings(example:CodeExample,eval_example:EvalExample):eval_example.lint(example)eval_example.run(example)Check print statementspytest-examplescan also check print statements are inserted correctly.There's the expected format of prints statemints in docstrings:defadd_two_things(a,b):"""```pyfrom my_lib import add_two_thingsprint(add_two_things(1, 2))#> 3```"""returna+bAnd here's an example of a markdown file, again documentingadd_two_things:# How `add_two_things` works```pyfrommy_libimportadd_two_thingsprint(add_two_things(1,2))#> 3```pytest-examplescan then run the code and check the print statements are correct:importpytestfrompytest_examplesimportfind_examples,CodeExample,EvalExample@pytest.mark.parametrize('example',find_examples('foo_dir'),ids=str)deftest_docstrings(example:CodeExample,eval_example:EvalExample):eval_example.run_print_check(example)Updating filesAs well as checking linting and print statements, are correct, we can also update files.This requires the--update-examplesflagsANDuse of theformat()andrun_print_update()methods.Here's a full example of a unit test that checks code when called normally, but can update it
when the flag is set:importpytestfrompytest_examplesimportfind_examples,CodeExample,EvalExample@pytest.mark.parametrize('example',find_examples('README.md'),ids=str)deftest_readme(example:CodeExample,eval_example:EvalExample):ifeval_example.update_examples:eval_example.format(example)eval_example.run_print_update(example)else:eval_example.lint(example)eval_example.run_print_check(example)
Package: pytest-exasol-itde
Thepytest-itdeplugin is a pytest plugin designed to facilitate the integration testing of projects using the Exasol Integration Test Docker Environment (ITDE).
This plugin was originally a part ofITDE, offering its functionalities directly within the test environment.FeaturesIntegration with ITDE:Designed to work closely with the Exasol Integration Test Docker Environment, enabling efficient setup, execution, and teardown of integration tests.Ease of Use:Simplifies the configuration and execution of tests by leveraging the pytest framework, making it accessible to developers familiar with pytest conventions.InstallationTo install the pytest-itde plugin, you can use pip:pipinstallpytest-itde
Package: pytest-excel
pytest-excel is a plugin forpy.testthat allows to
to create excel report for test results.RequirementsYou will need the following prerequisites in order to use pytest-excel:Python 3.9, 3.10 and abovepytest 3.6.0 or newerpandasInstallationTo install pytest-excel:$�pip install pytest-excelThen run your tests with:$�py.test --excelreport=report.xlsIf you would like more detailed output (one test per line), then you may use the verbose option:$ py.test --verboseIf you would like to run tests without execution to collect test doc string:$ py.test --excelreport=report.xls --collect-onlyIf you would like to get timestamp in the as filename:$ py.test --excelreport=report%Y-%M-dT%H%.xls
Package: pytest-exceptional
Better pytest ExceptionsThis plugin attempts to make richer pytest exceptions a snap to write.
For example, consider the following exception:classStartFire(pytest.Exception):__teststatus__='fire','🔥',('FIRE',{'purple':True,'bold':True})deftoterminal(self,longrepr,tw):tw.line("FIRE! Please evacuate the building!")longrepr.toterminal(tw)defsummary_header(self,header):return"Fire started during{}".format(header)When this specific exception class is thrown, the pretty printing and
result categorization is now in the hands of the exception, making it
more straightforward than writing special purpose plugins.:============================= test session starts ==============================
platform linux -- Python 3.6.0, pytest-3.0.7, py-1.4.32, pluggy-0.4.0
cachedir: .cache
rootdir: /home/simon/src/pytest-exceptional, inifile:
plugins: exceptional-0.1.0
collected 1 items

tests/test_fail_test.py::test_fire FIRE

________________________ Fire started during test_fire _________________________
FIRE! Please evacuate the building!

    def test_fire():
>       raise StartFire('There is a fire')
E       test_fail_test.StartFire: There is a fire

tests/test_fail_test.py:47: StartFire
============================ 1 fire in 0.02 seconds ============================TODOProvide more control over formatting and presentation without making
the API too cumbersome. Still very much an early prototype and
probably not close to a stable API.InstallationYou can install “pytest-exceptional” viapipfromPyPI:$ pip install pytest-exceptionalContributingContributions 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-exceptional” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a
detailed description.
Package: pytest-exception-script
pytest-exception-scriptThe goal of this pytest plugin is to allow quick and easy testing of your application's resiliency. This is accomplished by creating exception scripts / scenarios which allow you to inject exceptions into your code execution without having to repeatedly set-up tests.This won't work for applications that have multiple processes, but should work with threads (need to do more testing). Under the hood it's just abusing monkeypatch.StructureScripts can be written in YAML or TOML.
Each script / scenario (these will be used interchangeably below) consists of multiple acts, each of which can have multiple actions. Scenario is successful and complete if every act in it is complete.To have your script detected: make sure it starts withchaos_and is a toml or yaml file. It will get auto-discovered by pytest, or you can call pytest directly against the file.Examples of config files:Usingyamlentry-point: tests.fake_app_success.factory
next-point: tests.fake_app_success.process_data
acts:
  - tests.fake_app_success.get_data:
      - exc: KeyError, "Error in act I"
        next-point: 
    tests.fake_app_success.unused_method:
      - exc: OSError, "Custom message passed"
  - tests.fake_app_success.get_data:
      - exc: KeyErrorUsingtomlentry-point="tests.fake_app_success.factory"
next-point="tests.fake_app_success.process_data"
[[act]]
[[act."tests.fake_app_success.get_data"]]
exc="KeyError"
next-point="tests.fake_app_success.process_data"
[[act]]
[[act."tests.fake_app_success.get_data"]]
exc="KeyError"
[[act]]
[[act."tests.fake_app_success.get_data"]]
exc="KeyError"What's happening here?entry-pointshould be a factory for your application that takes no parameters.next-point- can be specified globally, per act, or both. Once this method gets called script will move on to the next act.acts- list of acts each of which consists of actors. Each Actor is a method and an exception that it will throw if called during execution.exc- exception to raise.So factory will be loaded and started, upon which first act starts. Every time whenget_datawill get calledKeyErrorwill be raised. With either a default or a custom message. Oncenext-pointgets called next act starts. Oncenext-pointof the last act is called the application terminates (hopefully) and all the tests get marked as complete.
Package: pytest-executable
pytest-executableis apytestplugin for simplifying the black-box
testing of an executable, be it written in python or not. It helps to avoid
writing the boilerplate test code to:define the settings of a test case in a yaml file,spawn a subprocess for running an executable,reorder the tests properly either for a single test case or across several test cases,handle the outputs and references directory trees,provide convenient fixtures to customize the checking of the outcome of an executable.It integrates naturally with standard test scripts written for pytest.This plugin is originally intended for testing executables that create
scientific data but it may hopefully be helpful for other kinds of executables.
This project is still young, but already used in a professional environment.DocumentationThe project documentation and installation instructions are availableonline.ContributingA contributing guide will be soon available (just a matter of free time).Please fill an issue on theGithub issue trackerfor any bug report, feature
request or question.AuthorsAntoine Dechaume-Project creator and maintainerCopyright and LicenseCopyright 2020,CS GROUPpytest-executableis a free and open source software, distributed under the
Apache License 2.0. See theLICENSE.txtfile for more information, or thequick summaryof this license ontl;drLegalwebsite.
Package: pytest-execution-timer
pytest-execution-timerA plugin to use with Pytest to measure execution time of tests.Distinctly different from the--durationsoption of pytest,
this plugin measures specific pytest startup/collection phases.Leveragespytesthooks to measure execution time of phases.InstallationRequires:Python 3.7 or later.Pytest 6.2 or later.Install the plugin with any approach for your project.Some examples:pipinstallpytest-execution-timerpoetryadd--devpytest-execution-timerpipenvinstall--devpytest-execution-timerOr add it to yourrequirements.txtfile.UsageEnable the plugin with the--execution-timeroption when runningpytest:$pytest--execution-timer...Durations of pytest phases in seconds (min 100ms):0.662	pytest_runtestloopControl the threshold (default 100ms) by passing--minimum-duration=<value in ms>:$pytest--execution-timer--minimum-duration=1000# 1 secondUnderstanding the outputThe best ay to start is to compare the difference of thepytest_runtestloopduration
and the overall duration of the test run. Example:Durations of pytest phases in seconds (min 100ms):0.666	pytest_runtestloop====== 4 passed in 0.68s ======In this example, there's not much lost between the test run and thepytest_runtestloopmeaning that the startup and collection phases are not taking too much time.If there's a larger difference in the timings,
look to other emitted phases to understand what's taking the most time.These can then be examined directly,
or use other tools likeprofilersorimport timings.LicenseDistributed under the terms of the MIT license,
"pytest-execution-timer" is free and open source software.
SeeLICENSEfor more information.
Package: pytest-exit-code
pytest-exit-codeApytestplugin that overrides the built-in exit codes to retain more information about the test results.FeaturesThis plugin changes the exit code returned by runningpytest.
The exit codes can range from0to15and are a combination of the following bitwise flags:FlagDescription0All tests passed.1One or more tests passed.2One or more tests failed.4One or more tests errored.8One or more tests were skipped.So:An exit code of2means that all tests failed.An exit code of6means that all tests either failed or errored.An exit code of7indicates that the result contains a mix of passed, failed and errored tests.Installation$pipinstallpython-exit-codeContributingContributions 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 theApache Software License 2.0license,pytest-exit-codeis free and open source software.
Package: pytest-expect
Apy.testplugin that stores test
expectations by saving the set of failing tests, allowing them to be
marked as xfail when running them in future. The tests expectations
are stored such that they can be distributed alongside the
tests. However, note that test expectations can only be reliably
shared between Python 2 and Python 3 if they only use ASCII characters
in their node ids: this likely isn’t a limitation if tests are using
the normal Python format, as Python 2 only allows ASCII characters in
identifiers.CompatibilityWe followsemver. Our public
API is defined by the expectation file and the command line parameters.In other words: for a given major release (e.g., 1.y.z), expectation
files and command line parameters will remain compatible. Across major
versions, we’ll try to break as little as possible. All pre-release
(0.y.z) versions should be compatible with each other, but are
unlikely to be compatible with 1.0.0.
Package: pytest-expecter
OverviewApytestplugin based ongarybernhardt/expecterto write expressive tests.Quick StartWith this plugin you can write tests (optionally usingpytest-describe) like this:defdescribe_foobar():defit_can_pass(expect):expect(2+3)==5defit_can_fail(expect):expect(2+3)==6and get output like this:=============================FAILURES=============================___________________describe_foobar.it_can_fail____________________defit_can_fail(expect):>expect(2+3)==6EAssertionError:Expected6butgot5test_foobar.py:7:AssertionError================1failed,1passedin2.67seconds================InstallationInstall it directly into an activated virtual environment:$ pip install pytest-expecteror add it to yourPoetryproject:$ poetry add pytest-expecter
Package: pytest-expectr
# pytest_expectrpytest-expectr is a plugin for [pytest](https://docs.pytest.org/en/latest/) that provide expect to tests/fixtures for multiple assert use.## RequirementsYou will need the following prerequisites in order to use pytest-expectr:- Python 2.7, 3.6, PyPy, or PyPy3- pytest 2.6 or newer## How to installTo install pytest-expectr:```bashpip install pytest-expectr```## How to use```pythondef test_hello(expect):expect(1==2, 'your error message 1')expect(1==3, 'your error message 2')...```