Saravanan666/pypi-org huggingface dataset:
Package: pytest-easy-addoption
pytest-easy-addoptionpytest addoption but with power of type annotations and dataclasses.More documentationhere.An quick example of a usage:frompytest_easy_addoptionimportAddOptionclassFooBarAddOption(AddOption):foo:strbar:str='BAR'defpytest_addoption(parser):FooBarAddOption.register(parser)from.conftestimportFooBarAddOptiondeftest_example(request):print(FooBarAddOption())$ pytest --foo="FOO"
============================= test session starts =============================
collected 1 items

test_sample.py FooBarAddOption(foo='FOO', bar='BAR')
.

=============================  1 passed in 0.03s  =============================
Package: pytest-easyMPI
Welcome to the pytest-easyMPI package!This package aims at making MPI code testing as similar to testing
regular serial code as possible. In doing so hopefully the users of
this plugin can focus more on writing tests of their MPI code and spend
less time figuring out how to integrate MPI tests into their other test
cases.Short exampleThe following shows an example of how to combine a serial and a parallel
test in a single test file. The parallel test is run using 4 MPI ranks:frompytest_easyMPIimportmpi_paralleldeftest_serial():assertTrue@mpi_parallel(4)deftest_parallel():# Import MPI only inside the test that needs it# (to avoid spawning too many MPI communicators)frommpi4pyimportMPIdata=MPI.COMM_WORLD.gather(MPI.COMM_WORLD.Get_rank())ifMPI.COMM_WORLD.Get_rank()==0:assertsum(range(MPI.COMM_WORLD.Get_size()))==sum(data)The test can then be run by calling:pytest
Package: pytest-easyread
# pytest-easyreadThis is a pytest plugin that aims to make the way pytest reports to terminal easier to read.### RequirementsYou will need the following prerequisites in order to use pytest-easyread:Python (tested on versions 2.7 and 3.4)pytest 3.0.4 or newer### InstallationTo install pytest-easyread:```$ pip install git+https://github.com/CrystalPea/pytest-easyread.git```Then add --easy flag when you run the tests, like this:```$ pytest --easy```### Ideal use- pytest-easyread is optimised for use with tests names that use underscores, like "test_this_feature_works"- For now pytest-easyread is set to verbose mode only
Package: pytest-easy-server
OverviewThepytest-easy-serverpackage is aPytestplugin that provides aPytest fixturefixturees_serverthat resolves
to the set of servers the tests should run against.The set of servers is defined in aserver file(aka “easy-server file”) and
the secrets to access the servers are defined in avault filethat is
referenced by the server file, in the formats defined by theeasy-server package.The files to use and the server or group nickname to select for the test, as
well as a schema file for validating the user-defined structure of certain
properties in the server and vault files, can be specified in pytest options
added by the plugin:--es-file=FILE
                        Path name of the easy-server file to be used.
                        Default: es_server.yml in current directory.

--es-nickname=NICKNAME
                        Nickname of the server or server group to test against.
                        Default: The default from the server file.

--es-schema-file=FILE
                        Path name of the schema file to be used for validating the structure of
                        user-defined properties in the easy-server server and vault files.
                        Default: No validation.

--es-encrypted          Require that the vault file (if specified) is encrypted and error out otherwise.
                        Default: Tolerate unencrypted vault file.Documentation and change logDocumentationChange logLicenseThe pytest-easy-server project is provided under theApache Software License 2.0.
Package: pytest-echo
Print environment variables, package version and generic attributes,
as they are at the beginning of the test.Useful in the continuous integration to dump test
configuration/environment and or to check if attributes are properly set
(ie. you change environment withos.environ)Installinstall via:pip install pytest-echoExamplesDump environment variables$pytest--echo-env=HOME=============================testsessionstarts=========================platformlinux2--Python2.7.4--py-1.4.22--pytest-2.6.0--/bin/pythonEnvironment:HOME:/Users/saxplugins:echo,pydev,cov,cache,djangoDump package version$pytest--echo-version=pytest_echo=============================testsessionstarts=========================platformlinux2--Python2.7.4--py-1.4.22--pytest-2.6.0--/bin/pythonPackageversion:pytest_echo:0.1plugins:echo,pydev,cov,cache,djangoWarningThe first attempt to retrieve the version is done via setuptools
if it fails, the module is imported (__import__(package)) to retrieve the version readingget_version,__version__,VERSION,versionso any module
level code is executed. This should be not an issue as no problematic code
should be present in the first level of the packageDump attributes$pytest--echo-attr=django.conf.settings.DEBUG=============================testsessionstarts=========================platformlinux2--Python2.7.4--py-1.4.22--pytest-2.6.0--/bin/pythonInspectionsdjango.conf.settings.DEBUG:Falseplugins:echo,pydev,cov,cache,djangoWarningBe careful when use--echo-attr. It loads any module in the path and this will
execute any module level code
If you try to dump a property, relatedgetterwill be executed.NoteYou cannot dump callable result.Configure via tox.ini/setup.cfg/pytest.cfgExample of use in a django project:[pytest]addopts=-vvv--tb=short--capture=no--echo-env PWD--echo-env VIRTUAL_ENV--echo-env DBENGINE--echo-version django--echo-version pip--echo-version pytest-echo--echo-attr django.conf.settings.DATABASES.default.ENGINE$pytest=============================testsessionstarts=========================platformlinux2--Python2.7.4--py-1.4.22--pytest-2.6.0--/bin/pythonEnvironment:DJANGO_SETTINGS_MODULE:tests.settingsPWD:/data/PROGETTI/semVIRTUAL_ENV:/data/VENV/semDBENGINE:<notset>Packageversion:django:1.6.5pip:1.5.6pytest_echo:1.2Inspections:django.conf.settings.DATABASES.default.ENGINE:'django.db.backends.postgresql_psycopg2'plugins:echo,cache,capturelog,contextfixture,cov,django,pydevcollected14items.............14passedin4.95secondsGlobbingStarting from version 1.5, is possible to glob packages version and environment variables,
as:$pytest--echo-version=pytest-*--echo-env=VIRTUAL*or[pytest]addopts=-vvv--echo-env VIRTUAL*--echo-version pytest-*LinksStableDevelopmentProject home page:https://github.com/pytest-dev/pytest-echoIssue tracker:https://github.com/pytest-dev/pytest-echo/issuesCI:https://travis-ci.org/pytest-dev/pytest-echoDownload:https://pypi.org/project/pytest-echo/Documentation:https://pytest-echo.readthedocs.io/en/latest/
Package: pytest-ekstazi
pytest-ekstazipytest-ekstazi is a plugin for pytest that selects the test cases that need to be run based on the Ekstazi algorithm.RequirementsYou will need the following prerequisites in order to use pytest-ekstazi:Python 3.7 or newerPytest 6.0.0 or newerInstallationTo install pytest-ekstazi:pipinstallpytest-ekstaziSelecting the test casesUse the--ekstazicommand line option to enable the plugin. For the first session the plugin is going to run the entire test suite and map the depedencies of each test function. The next executions, Ekstazi is going to check for each test function if their dependency files have changed. Just test cases with depedencies that have changed will run.pytest--ekstazi.For every run, the plugin saves/updates the dependency tree, last test results and dependency hashes in a configuration file. By default the configuration file is saved in working directory under nameekstazi.json. You can change the configuration file location by doing:pytest--ekstazi--ekstazi-filepath/to/bar.jsonRun the plugin always in the same directory or pass full path of the configuration file, otherwise the plugin will not be able to select the test case based on previous result.DevelopmentTo setup the development environment, first make surePython >= 3.7is installed in your machine. So clone the repo:gitclonehttps://github.com/Igorxp5/pytest-ekstazi.gitOpen the project directory and install the plugin ineditable-mode:pipinstall-e.CreditsEkstazi is Regression Test Selection algorithm created by Milos Gligoric, Lamyaa Eloussi, and Darko Marinov. Check out the theirresearch paper.
Package: pytest-eliot
Pytest-eliotFixtures to use eliot from pytest.Testing your loggingpytest-eliot allows using eliot with pytest. The usage is kind of different and
adapted to pytest style.https://eliot.readthedocs.io/en/stable/generating/testing.htmlLinting your logspytest-eliot provides a fixture that can be used as a context manager. The eliot
capture_logging is provided as the fixture eliot_capture_logging.The context manager will ensure that:You haven't logged anything that isn't JSON serializable.There are no unexpected tracebacks, indicating a bug somewhere in your code.deftest_mytest(eliot_capture_logging):witheliot_capture_logging():call_my_function()Making assertions about the logsYou can also ensure the correct messages were logged.fromeliotimportlog_messageclassUserRegistration(object):def__init__(self):self.db={}defregister(self,username,password,age):self.db[username]=(password,age)log_message(message_type="user_registration",username=username,password=password,age=age)Here's how we'd test it:frommyapp.registrationimportUserRegistrationdeftest_registration(eliot_capture_logging):registry=UserRegistration()witheliot_capture_logging()aslogger:registry.register("john","password",12)msg=logger.messages[0]fields={"username":"john","password":"password","age":12}assertfields.items()<=msg.items()# Fields items is a subset of msg items.assertregistry.db["john"]==("password",12)Testing tracebakcsEliot provides utilities for making assertions about the structure of individual
messages and actions. The simplest method is using the assertHasMessage utility
function which asserts that a message of a given message type has the given
fields:deftest_badpath(eliot_capture_logging):mything=MyThing()witheliot_capture_logging()aslogger:mything.load("/nonexistant/path")messages=logger.flush_tracebacks(OSError)assertlen(messages)==1Testing Message and Action Structurepytest-eliotprovides utilities for making assertions about the structure of
individual messages and actions. The simplest method is using theeliot_has_messageutility function which asserts that a message of a given
message type has the given fields:deftest_registration(eliot_capture_logging,eliot_has_message):witheliot_capture_logging()aslogger:registry=UserRegistration()registry.register("john","password",12)asserteliot_has_message(logger,message_type="user_registration",fields={"username":"john","password:""password","age":12})Custom JSON encodingCustom testing setupMust wrap all low level functions here as fixtures.
Package: pytest-embedded-arduino
pytest-embedded-arduinopytest embedded service for Arduino projectExtra Functionalities:.. tabs::

   .. group-tab:: `pytest-embedded-serial-esp` activated

        - `app`: Parse Arduino's build directory and gather more information.
        - `serial`: Auto flash the built binary into the target board at the beginning when running test cases.

   .. group-tab:: `pytest-embedded-serial-esp` NOT activated

        - `app`: Parse Arduino's build directory and gather more information.
Package: pytest-embedded-idf
pytest-embedded-idfpytest embedded service for esp-idf projectExtra Functionalities:.. tabs::

   .. group-tab:: `pytest-embedded-serial-esp` activated

        - `app`: parse the built binary by idf rules and gather more information.
        - `serial`: auto flash the built binary into the target board at the beginning when running test cases.

   .. group-tab:: `pytest-embedded-serial-esp` NOT activated

        - `app`: parse the built binary by idf rules and gather more information.
Package: pytest-embedded-qemu
pytest-embedded-qemupytest embedded service for running tests on QEMU instead of the real target.Extra Functionalities:.. tabs::

   .. group-tab:: `pytest-embedded-idf` activated

        - `app`: create the qemu bootable image automatically by the built binaries.
        - `qemu`: enable the fixture
        - `dut`: duplicate the `qemu` output to `pexpect_proc`.

   .. group-tab:: `pytest-embedded-idf` NOT activated

        - `qemu`: enable the fixture
        - `dut`: duplicate the `qemu` output to `pexpect_proc`.
Package: pytest-embedded-wokwi
pytest-embedded-wokwipytest-embedded service for running tests onWokwiinstead of the real target.Wokwi supports most ESP32 targets, including: esp32, esp32s2, esp32s3, esp32c3, esp32c6, and esp32h2. In addition, it supports awide range of peripherals, including sensors, displays, motors, and debugging tools.Running the tests with Wokwi requires an internet connection. Your firmware is uploaded to the Wokwi server for the duration of the simulation, but it is not saved on the server. On-premises Wokwi installations are available for enterprise customers.Wokwi CLI installationThe Wokwi plugin uses theWokwi CLIto interact with the wokwi simulation server. You can download the precompiled CLI binaries from thereleases page. Alternatively, on Linux or Mac OS, you can install the CLI using the following command:curl-Lhttps://wokwi.com/ci/install.sh|shAnd on Windows:iwrhttps://wokwi.com/ci/install.ps1-useb|iexWokwi API TokensBefore using this plugin, you need to create a free Wokwi account andgenerate an API key. You can then set theWOKWI_CLI_TOKENenvironment variable to the API key.Linux / Mac OS / WSL:exportWOKWI_CLI_TOKEN="your-api-key"Windows PowerShell:$env:WOKWI_CLI_TOKEN="your-api-key"UsageTo run your tests with Wokwi, make sure to specify thewokwiservice when running pytest, e.g.:pytest --embedded-services idf,wokwiTo limit the amount of simulation time, use the--wokwi-timeoutflag. For example, to set the simulation time limit to 60 seconds (60000 milliseconds):pytest --embedded-services idf,wokwi --wokwi-timeout=60000
Package: pytest-emoji
pytest-emojiA pytest plugin that adds emojis to your test result report 😍pytestpytest is a mature testing framework for Python that is developed by a
thriving community of volunteers. It uses plain assert statements and regular
Python comparisons. Writing tests with pytest requires little to no
boilerplate code and powerful features allow easy parametrization and
intelligent test selection.There are hundreds of plugins available for pytest with which you can extend
and customize your testing harness. Distributed under the terms of the MIT
license, pytest is free and open source software.Check outpytestif you haven't already and if you're not sold just
yet, install this plugin. Maybe that will get you motivated to write more
tests! 😁This pytest plugin was generated withCookiecutteralong with@hackebrot'scookiecutter-pytest-plugintemplate. 🍪Installationpytest-emojiis available for Python 3. 🐍You can installpytest-emojiviapipfromPyPI:$ pip install pytest-emojiThis will automatically installpytestof version 4.2.1 or higher.FeaturesThis plugin adds a--emojiCLI flag to pytest, which replaces the test
result indicator to emojis, both fornormalandverbosemode.😃 / PASSED 😃for passed tests😰 / FAILED 😰for failed tests😞 / XFAIL 😞for xfailed tests😲 / XPASS 😲for xpassed tests🙄 / SKIPPED 🙄for skipped tests😡 / ERROR 😡for tests with errorsNormal mode:$ pytest --emojitests/test_emoji.py 😃 😰 😞 😲 🙄 😡Verbose mode:$ pytest --verbose --emojitests/test_emoji.py::test_passed PASSED 😃
tests/test_emoji.py::test_failed FAILED 😰
tests/test_emoji.py::test_xfailed XFAIL 😞
tests/test_emoji.py::test_xpassed XPASS 😲
tests/test_emoji.py::test_skipped SKIPPED 🙄
tests/test_emoji.py::test_error ERROR 😡CustomizationYou can also change the emojis, if you want. 😛Add aconftest.pyto your tests folder and implement the following hooks.
If you wish to use the default, omit the according hook.defpytest_emoji_passed(config):return"🍪 ","PASSED 🍪 "defpytest_emoji_failed(config):return"😿 ","FAILED 😿 "defpytest_emoji_skipped(config):return"🙈 ","SKIPPED 🙈 "defpytest_emoji_error(config):return"💩 ","ERROR 💩 "defpytest_emoji_xfailed(config):return"🤓 ","XFAIL 🤓 "defpytest_emoji_xpassed(config):return"😜 ","XPASS 😜 "Naming the hooks correctly is important, make sure you don't make any typos⚠️All of these hooks receive the pytestconfigobject, which allows you to
check options and further customize the output. All hooks need to return a
tuple ofstras in("<shortletter>", "<verbose-word>").It's recommended for emoji to add an extra" "(blank) for better formatting.CommunityAre you interested in contributing topytest-emoji? Your contributions are
greatly appreciated! Every little bit helps, and credit will always be given!Everyone interacting in thepytest-emojiproject's codebases, issue
trackers, chat rooms, and mailing lists is expected to follow thePyPA Code
of Conduct.IssuesIf you encounter any problems, pleasefile an issuealong with a
detailed description.LicenseDistributed under the terms of theMITlicense,pytest-emojiis
free and open source software
Package: pytest-emoji-output
Pytest emoji outputA pytest plugin that helps to reflect tests output with emoji.ToolsProductionpython 3.7, 3.8, 3.9, 3.10pytestDevelopmenttravisblackmypypylintflake8interrogateInstallationPlease run following script to obtain latest package from PYPI:pipinstallpytest-emoji-outputThen please execute command below:pytest--emoji-out/--eo<your-tests-directory>Source codeTo be able to use plugin from the source code please execute commands below:gitclonegit@github.com:vyahello/pytest-emoji-output.git
pipinstall-e.⬆ back to topDevelopment notesConfigurationIn order to enable plugin automatically within yourpytest.iniconfiguration file, please set an appropriate flag:[pytest]addopts=--emoji-outor a shorten version:[pytest]addopts=--eoTestingGenerally,pytesttool is used to organize testing procedure.Please follow next command to run unittests:pytestIn addition, package unit tests are implemented withbatsframework:PACKAGE_NAMEandPACKAGE_VERSIONenvironment variables should be set to run tests.bats--prettytest-package.batsCIProject has Travis CI integration using.travis.ymlfile thus code analysis (black,pylint,flake8) and unittests (pytest) will be run automatically
after every made change to the repository.To be able to run code analysis, please execute command below:./analyse-code.shRelease notesPlease checkchangelogfile to get more details about actual versions and it's release notes.MetaAuthor –Volodymyr YahelloDistributed under theMITlicense. SeeLICENSEfor more information.You can reach out me at:vyahello@gmail.comhttps://twitter.com/vyahellohttps://www.linkedin.com/in/volodymyr-yahello-821746127ContributingI would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:Clone the repositoryConfiguregitfor the first time after cloning with yournameandemailpip install -r requirements.txtto install all project dependenciespip install -r requirements-dev.txtto install all development project dependenciesCreate your feature branch (git checkout -b feature/fooBar)Commit your changes (git commit -am 'Add some fooBar')Push to the branch (git push origin feature/fooBar)Create a new Pull RequestWhat's nextAll recent activities and ideas are described at projectissues.
If you have ideas you want to change/implement please do not hesitate and create an issue.⬆ back to top
Package: pytest-enabler
Theenablerplugin allows configuration of plugins if present, but omits the settings if the plugin is not present. For example, the following config enables black to be enabled when present:[tool.pytest-enabler.black]
addopts = "--black"Then, to temporarily disable a plugin, use pytest’s built-in support for disabling a plugin:pytest -p no:blackenablerincludes adefault config.Known to work with the following plugins:pytest-blackpytest-covpytest-flake8pytest-mypypytest-ruffpytest-xdistpytest-ignore-flaky
Package: pytest-enhancements
pytest-enhancementsEnhancements to pytest that were rejected upstream.
Might involve monkey-patching pytest directly.. :/See alsomy pytest branch with more enhancements.FeaturesSupports passing dictionaries to@pytest.mark.parametrize:@pytest.mark.parametrize('arg1,arg2,expected_id',{"myid_12":[1,2,"[myid_12]"],"replaced_id":pytest.param(3,4,"[replaced_id]",id="myid_34"),"myid_56":pytest.param(5,6,"[myid_56]"),})deftest_parametrize_dict(request,arg1,arg2,expected_id):ifexpected_idisNone:expected_id="[%d-%d-None]"%(arg1,arg2)assertrequest.node.nodeid.endswith(expected_id)(rejected inhttps://github.com/pytest-dev/pytest/pull/5850)Installation$ pip install pytest-enhancementsLicenseDistributed under the terms of theGNU GPL v3.0license.
Package: pytest-env
pytest-envThis is apytestplugin that enables you to set environment variables in apytest.iniorpyproject.tomlfile.InstallationInstall with pip:pipinstallpytest-envUsageNative form inpyproject.toml[tool.pytest_env]HOME="~/tmp"RUN_ENV=1TRANSFORMED={value="{USER}/alpha",transform=true}SKIP_IF_SET={value="on",skip_if_set=true}Thetool.pytest_envtables keys are the environment variables keys to set. The right hands-ide of the assigment:if an inline table you can set options via thetransformorskip_if_setkeys, while thevaluekey holds the
value to set (or transform before setting). For transformation the variables you can use is other environment
variable,otherwise the value to set for the environment variable to set (casted to a string).Via pytest configurationsIn your pytest.ini file add a key value pair withenvas the key and the environment variables as a line separated
list ofKEY=VALUEentries. The defined variables will be added to the environment before any tests are run:[pytest]env=HOME=~/tmpRUN_ENV=testOr withpyproject.toml:[tool.pytest.ini_options]env=["HOME=~/tmp","RUN_ENV=test",]Only set if not already setYou can useD:(default) as prefix if you don't want to override existing environment variables:[pytest]env=D:HOME=~/tmpD:RUN_ENV=testTransformationYou can use existing environment variables using a python-like format, these environment variables will be expended
before setting the environment variable:[pytest]env=RUN_PATH=/run/path/{USER}You can apply theR:prefix to keep the raw value and skip this transformation step (can combine with theD:flag,
order is not important):[pytest]env=R:RUN_PATH=/run/path/{USER}R:D:RUN_PATH_IF_NOT_SET=/run/path/{USER}
Package: pytest-envfiles
pytest-envfilespytest-envfiles is a py.test plugin that allows you to specify environment variable files that are to be parsed prior
to executing tests.  These files contain environment variables in a KEY=VALUE format.InstallationUse pip:pipinstallpytest-envfilesUsageIn your pytest.ini file add a key,env_filesand the environment variable files as a line
separated list.  The listed files will be parsed prior to test execution[pytest]env_files=./common.env./tests.env/opt/secrets.env