Saravanan666/pypi-org huggingface dataset:
Package: pytest-pytestrail
pytest-pytestrailPytest plugin for interaction with TestRailInstallpipinstallpytest-pytestrailExamplefrompytest_pytestrailimportpytestrail@pytestrail.case('C32')deftest_one():assertTrue@pytestrail.case('C12')deftest_two():assertTrueStepsfrompytest_pytestrailimportpytestrailcase=pytestrail.steps_case('C3')@case.step(1)deftest_step_one():assertTrue@case.step(2)deftest_step_two():assertTrueSteps parametrizefrompytest_pytestrailimportpytestrailimportpytest@pytest.mark.parametrize('data',pytestrail.params('C84',[1,23,33,1,57]))deftest_five(data):assertdata@pytest.mark.parametrize('data',[pytestrail.param(1,'C55'),pytestrail.param(2,'C56')])deftest_six(data):assertdataConfigurationSupport environment variablesTESTRAIL_URLTESTRAIL_EMAILTESTRAIL_PASSWORDConfig filepytest.iniorsetup.cfgpytest configuration[pytest]pytestrail (bool):Enable pluginpytestrail-url (string):TestRail addresspytestrail-email (string):Email for the account on the TestRailpytestrail-password (string):Password for the account on the TestRailpytestrail-test-run (string):ID testrunpytestrail-no-decorator-skip (bool):Skip tests without decoratorpytestrail-report (bool):Enable reportpytestrail-no-ssl-check (bool):Do not check for valid SSL certificate on TestRail hostpytestrail-project-id (string):ID of the projectpytestrail-suite-id (string):ID of the test suitepytestrail-testrun-name (string):Name given to testrun, that appears in TestRailpytestrail-date-format (string):Date format (default: %Y-%m-%d %H:%M:%S)pytestrail-tz-local (bool):Use local time zone (Default: UTC)pytestrail-close-on-complete (bool):Close test run on completionpytestrail-milestone-id (string):Set test tun milestonepytestrail-testrun-description (string):Description given to testrun, that appears in TestRailorCommand line options--pytestrailEnableplugin
--tr-url=TR_URLTestRailaddress
--tr-email=TR_EMAILEmailfortheaccountontheTestRail
--tr-password=TR_PASSWORDPasswordfortheaccountontheTestRail
--tr-test-run=TR_TEST_RUNIDtestrun
--tr-no-decorator-skipSkiptestswithoutdecorator
--tr-reportEnablereport
--tr-no-ssl-checkDonotcheckforvalidSSLcertificateonTestRailhost
--tr-project-id=TR_PROJECT_IDIDoftheproject
--tr-suite-id=TR_SUITE_IDIDofthetestsuite
--tr-testrun-name=TR_TESTRUN_NAMENamegiventotestrun,thatappearsinTestRail
--tr-date-format=TR_DATE_FORMATDateformat(default:%Y-%m-%d%H:%M:%S)--tr-tz-localUselocaltimezone(Default:UTC)--tr-close-on-completeClosetestrunoncompletion
--tr-milestone-id=TR_MILESTONE_IDSettesttunmilestone
--tr-testrun-description=TR_TESTRUN_DESCRIPTIONDescriptiongiventotestrun,thatappearsinTestRail
Package: pytest-pythonpath
pytest-pythonpathNOTE:This plugin is obsolete as of pytest 7.0.0.  Thanks tothis PRfromBrian Okken, you can now modify the PYTHONPATH using thepythonpathconfiguration option.  See documentation here:https://docs.pytest.org/en/7.0.x/reference/reference.html#confval-pythonpathThis is a py.test plugin for adding to the PYTHONPATH from the pytests.ini file before tests run.InstallationInstall with pip::pip install pytest-pythonpathUninstall with pip::pip uninstall pytest-pythonpathUsageAdd a line in your pytest.ini file with a key ofpython_pathsand provide a space seperated list of paths
you want inserted to the beginning of the PYTHONPATH before any tests run:[pytest]
python_paths = your/path/apps your/path/libsIf you'd like to have.pthfiles be processed too, usesite_dirsinstead:[pytest]
site_dirs = your/path/apps your/path/libsThis will cause theaddsitedirfunction to be called on each path instead of a simplesys.path.insert(0, path).
Note that using thesite_dirswill not place your specified paths in front of existing paths.Once this is added to your pytest.ini, you can use the py.test command as you normally would.
Package: pytest-pytorch
pytest-pytorchWhat is it?pytest-pytorchis a lightweightpytest-plugin that enhances the developer experience when working with the PyTorch test suite if you come from apytestbackground.Why do I need it?Some testcases in the PyTorch test suite are automatically generated when a module is loaded in order to parametrize them. Trying to collect them with their names as written, e.g.pytest test_foo.py::TestFooorpytest test_foo.py::TestFoo::test_bar, is unfortunately not possible. If you are used to this syntax or your IDE relies on it (PyCharm,VSCode), you can installpytest-pytorchto make it work.How do I install it?You can installpytest-pytorchwithpip$pipinstallpytest-pytorchor withconda:$condainstall-cconda-forgepytest-pytorchHow do I use it?Withpytest-pytorchinstalled you can select test cases and tests as if the instantiation for different devices was performed by@pytest.mark.parametrize:Use caseCommandRun a test case against all devicespytest test_foo.py::TestBarRun a test case against one devicepytest test_foo.py::TestBar -k "$DEVICE"Run a test against all devicespytest test_foo.py::TestBar::test_bazRun a test against one devicepytest test_foo.py::TestBar::test_baz -k "$DEVICE"Can I have a little more background?PyTorch uses its own method for generating tests that is for the most part compatible withunittestand pytest. Its custom test generation allows test templates to be written and instantiated for different device types, data types, and operators. Consider the following moduletest_foo.py:fromtorch.testing._internal.common_utilsimportTestCasefromtorch.testing._internal.common_device_typeimportinstantiate_device_type_testsclassTestFoo(TestCase):deftest_bar(self,device):passdeftest_baz(self,device):passinstantiate_device_type_tests(TestFoo,globals())Assuming we"cpu"and"cuda"are available as devices, we can collect four tests:test_foo.py::TestFooCPU::test_bar_cpu,test_foo.py::TestFooCPU::test_baz_cpu,test_foo.py::TestFooCUDA::test_bar_cuda, andtest_foo.py::TestFooCUDA::test_baz_cuda.From apytestperspective this is similar to decoratingTestFoowith@pytest.mark.parametrize("device", ("cpu", "cuda")))which would result intest_foo.py::TestFoo:test_bar[cpu],test_foo.py::TestFoo:test_bar[cuda],test_foo.py::TestFoo:test_baz[cpu], andtest_foo.py::TestFoo:test_baz[cuda].Since the PyTorch test framework renames testcases and tests, naively runningpytest test_foo.py::TestFooorpytest test_foo.py::TestFoo::test_barfails, because it can't find anything matching these names. Of course you can get around it by using the regular expression matching (-kcommand line flag) thatpytestoffers.pytest-pytorchperforms this matching so you can keep your familiar workflow and your IDE is happy out of the box.How do I contribute?First and foremost: Thank you for your interest in development ofpytest-pytorch's! We appreciate all contributions be it code or something else. Check out ourcontribution guide linesfor details.
Package: pytest-pyvenv
Pytest-pyvenvThis is a simple plugin forpytestthat allows you to create a virtual environment inside the tests.InstallationFrom PyPIpipinstallpytest-pyvenvFrom Sourcepipinstallgit+https://github.com/msinamsina/pytest-pyvenv.gitUsagedeftest_env(pyvenv):pyvenv.install_package('pytest-pyvenv')pyvenv.run('mkdir -p tests')ContributingPull requests are welcome. For major changes, please open an issue
first to discuss what you would like to change.
Package: pytest-qatouch
pytest-qatouchPytest plugin for uploading test results to your QA Touch Testrun.FeaturesIt only will upload the test results to the specified testrun in your Qatouch portalInstallationYou can install "pytest-qatouch" viapipfromPyPI::pipinstallpytest-qatouchUsagefrompytest_qatouchimportqatouch@qatouch.TR(10)deftest_for_testcase_number0010():assertTrue@qatouch.TR(9)deftest_for_testcase_number0009():assertFalseAnd If you want to use it with a parameterized tests , you can do as the example below.importpytestfrompytest_qatouchimportqatouch@pytest.mark.parametrize("num1,num2",[(9,8),pytest.param(8,10,marks=qatouch.TR(2)),pytest.param(0,10,marks=qatouch.TR(10)),pytest.param(1,4,marks=qatouch.TR(9)),],)deftest_sum_greater_than10(num1,num2):assertnum1+num2>=10ConfigurationYou can use aconfig fileor pass it topytestascommand line options.Config filepytest.iniorsetup.cfgpytest configuration[pytest]qatouch (string):Enable the qatouch plugin (Set it to 'True' to enable it)qatouch-subdomain (string):Your qatouch submodule name (i.e <your_subdomain>.qatouch.com)qatouch-api-token (string):Your qatouch API tokenqatouch-project-key (string):The qatouch project keyqatouch-testrun-key (string):The testrun key in qatouch projectCommand line options--qatouchEnabletheqatouchplugin(Setitto'True'toenableit)--qatouch-subdomainYourqatouchsubmodulename(i.e<your_subdomain>.qatouch.com)--qatouch-api-tokenYourqatouchAPItoken
--qatouch-project-keyTheqatouchprojectkey
--qatouch-testrun-keyThetestrunkeyinqatouchprojectUser guideFor further documentation seewikiand checkout this video:IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.ContributingContributions are very welcome.DevelopmentTo start development,run your python environment then run the following commands:# Update pip, wheel and setuptoolspython-mpipinstall-Upipwheelsetuptools# Instal all the needed dependenciespipinstall-e.[dev]
Package: pytest-qml
# pytest-qml![build](https://github.com/jgirardet/pytest-qml/workflows/build/badge.svg?branch=master)
![pypi](https://img.shields.io/pypi/v/pytest-qml.svg)
![downloads](https://static.pepy.tech/badge/pytest-qml)## Run QML Tests with PyTestThis pytest plugin allows you to run qml tests via pytest
instead of the C++/QtQuick test runner. It supports both PySide2 and PyQt5 >= 5.14.2 .![test_result](docs/test_result.png)For installation, usage, contributing, please read the doc  [https://jgirardet.github.io/pytest-qml/](https://jgirardet.github.io/pytest-qml/)
Package: pytest-qr
pytest plugin to generate test result QR codesFeaturesprints a QR code :)RequirementsqrcodeInstallationYou can install “pytest-qr” viapipfromPyPI:$ pip install pytest-qrUsageRunpy.testwith–qr:$ py.test --qr
…
    █▀▀▀▀▀█ █ █ ▀▄█ ██▄▀▄ █▀▀▀▀▀█
    █ ███ █ ▄ ▀█▄█▄▄ ▄█▀▀ █ ███ █
    █ ▀▀▀ █  █ ▀▄   █▀▀█▄ █ ▀▀▀ █
    ▀▀▀▀▀▀▀ █ █ ▀ █ ▀▄▀ ▀ ▀▀▀▀▀▀▀
    ▀ ██▄█▀█▄ █▀█▄▀ ▀▀▄█▄▄█▄▄█ █▀
    ▄ ██▄▀▀▀█▀ █▀█▄ ▄▀ ▄█▀▄▄ ▄▀█
    ██▄▀█ ▀ ██▄█▀▀▀█▀▄▄█ █▄   █ ▀
    ▄▄▄▄▄▀▀▄██ ▀   ▄▄▀ ▀▀▀ ▀█▀ ▀█
      ▄█ █▀  ▄▀▄█▀███▄▀▀█▄ ▄▀ ▄▀█
    ▀  ██ ▀ █▄▄▄█ ▀▀▄██ ██▄█ ▀▄▄▄
     ▀   ▀▀ ▄▄█ █ ▄ ███▀█▀▀▀█▀▀█▀
    █▀▀▀▀▀█ █ ▀▀ ▄▀ ▀▀▄▀█ ▀ █ ▀▀
    █ ███ █ ▄ ██▄▄▄█▄█▄ ▀▀▀▀█▀▄▀█
    █ ▀▀▀ █ ▀▀▄█▄▀█▄▀ ▄  ▄ █▄█ ▄▀
    ▀▀▀▀▀▀▀ ▀▀▀ ▀▀  ▀ ▀▀▀  ▀   ▀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-qr” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-qt
pytest-qt is apytestplugin that allows programmers to write tests
forPyQt5,PyQt6,PySide2andPySide6applications.The main usage is to use theqtbotfixture, responsible for handlingqAppcreation as needed and provides methods to simulate user interaction,
like key presses and mouse clicks:deftest_hello(qtbot):widget=HelloWidget()qtbot.addWidget(widget)# click in the Greet button and make sure it updates the appropriate labelqtbot.mouseClick(widget.button_greet,qt_api.QtCore.Qt.MouseButton.LeftButton)assertwidget.greet_label.text()=="Hello!"This allows you to test and make sure your view layer is behaving the way you expect after each code change.Featuresqtbotfixture to simulate user interaction withQtwidgets.Automatic captureofqDebug,qWarningandqCriticalmessages;waitSignalandwaitSignalsfunctions to block test execution until specific
signals are emitted.Exceptions in virtual methods and slotsare automatically captured and
fail tests accordingly.RequirementsSince version 4.1.0,pytest-qtrequires Python 3.7+.Works with eitherPySide6,PySide2,PyQt6orPyQt5.If any of the above libraries is already imported by the time the tests execute, that library will be used.If not, pytest-qt will try to import and use the Qt APIs, in this order:PySide6PySide2PyQt6PyQt5To force a particular API, set the configuration variableqt_apiin yourpytest.inifile topyside6,pyside2,pyqt6orpyqt5:[pytest]qt_api=pyqt5Alternatively, you can set thePYTEST_QT_APIenvironment
variable to the same values described above (the environment variable wins over the configuration
if both are set).DocumentationFull documentation and tutorial available atRead the Docs.Change LogPlease consult thechangelog page.Bugs/RequestsPlease report any issues or feature requests in theissue tracker.ContributingContributions are welcome, so feel free to submit a bug or feature
request.Pull requests are highly appreciated! If you
can, include some tests that exercise the new code or test that a bug has been
fixed, and make sure to include yourself in the contributors list. :)To prepare your environment, create a virtual environment and installpytest-qtin editable mode withdevextras:$ pip install --editable .[dev]After that installpre-commitfor pre-commit checks:$ pre-commit installRunning testsTests are run usingtox:$ tox -e py37-pyside2,py37-pyqt5pytest-qtis formatted usingblackand usespre-commitfor linting checks before commits. You
can installpre-commitlocally with:$ pip install pre-commit
$ pre-commit installRelated projectspytest-xvfballows to run a virtual xserver (Xvfb) on Linux to avoid GUI elements popping up on the screen or for easy CI testingpytest-qmlallows running QML tests from pytestContributorsMany thanks to:Igor T. Ghisi (@itghisi);John David Reaver (@jdreaver);Benjamin Hedrich (@bh);Benjamin Audren (@baudren);Fabio Zadrozny (@fabioz);Datalyze Solutions (@datalyze-solutions);Florian Bruhin (@The-Compiler);Guilherme Quentel Melo (@gqmelo);Francesco Montesano (@montefra);Roman Yurchak (@rth)Christian Karl (@karlch)Powered by
Package: pytest-qt-app
Set up a Q Application for QT with an X-Window Virtual Framebuffer
(Xvfb).InstallationInstall using your favourite package installer:pipinstallpytest-qt-app# oreasy_installpytest-qt-appEnable the fixture explicitly in your tests or conftest.py (not required
when using setuptools entry points):pytest_plugins=['pytest_qt_app']ConfigurationThe fixtures are configured using the following evironment variables:SettingDescriptionDefaultSERVER_FIXTURES_XVFBXvfb server executable/usr/bin/XvfbUsageHere’s a little test that shows it working:fromPyQt4importQtguideftest_q_application(q_application):# This shows the display is connected properly to the XvfbassertQtGui.QX11Info.display()Changelog1.0.1 (2015-12-23)Packaging bugfix1.0.0 (2015-12-21)Initial public release
Package: pytest_quickify
pytest-quickifyA PyTest Plugin for Reordering Test SuitesKey Featurespytest-quickify is a Pytest plugin that reorders test suites according to measures of test effectiveness including:A comparison of test coverage and test running timeDetermined test complexityHistory of passed and failed test casesContributingAre you interested in contributing topytest-quickify? Our development team uses theGitHub Flow Modelto guide our engineering of these tools and we invite you to also follow it as you make a contribution. Of course, if you have any problems with installing, testing, or using pytest-fleetflakefinder, then please raise an issue associated with this Git repository using the "Issues" link at the top of this site. The contributors to this project will do all that they can to resolve your issue and ensure that the entire tool works well in your Python development environment.
Package: pytest-rabbitmq
pytest-rabbitmqPackage statusWhat is this?This is a pytest plugin, that enables you to test your code that relies on a running RabbitMQ Queues.
It allows you to specify additional fixtures for RabbitMQ process and client.How to usePlugin contains two fixturesrabbitmq- it’s a client fixture that has functional scope. After each test, it cleans RabbitMQ, cleans queues and exchanges for more reliable tests.rabbitmq_proc- session scoped fixture, that starts RabbitMQ 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 rabbitmq client and process fixtures if you’d need to:frompytest_rabbitmqimportfactoriesrabbitmq_my_proc=factories.rabbitmq_proc(port=None,logsdir='/tmp')rabbitmq_my=factories.rabbitmq('rabbitmq_my_proc')NoteEach RabbitMQ 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 optionsRabbitMQ optionFixture factory argumentCommand line optionpytest.ini optionDefaulthosthost–rabbitmq-hostrabbitmq_host127.0.0.1RABBITMQ_NODE_PORTport–rabbitmq-portrabbitmq_portrandomRABBITMQ_DIST_PORTdistribution_port–rabbitmq-distribution-portrabbitmq_distribution_portrandomrabbitmqctl pathctl–rabbitmq-ctlrabbitmq_ctl/usr/lib/rabbitmq/bin/rabbitmqctlrabbitmq server pathserver–rabbitmq-serverrabbitmq_server/usr/lib/rabbitmq/bin/rabbitmq-serverLog directory locationlogsdir–rabbitmq-logsdirrabbitmq_logsdir$TMPDIRPlugin directory locationplugin_path–rabbitmq-plugindirrabbitmq_plugindir$TMPDIRNode namenode–rabbitmq-noderabbitmq_noderabbitmq-test-{port}Example usage:pass it as an argument in your own fixturerabbitmq_proc=factories.rabbitmq_proc(port=8888)use--rabbitmq-portcommand line option when you run your testspy.test tests --rabbitmq-port=8888specify your port asrabbitmq_portin yourpytest.inifile.To do so, put a line like the following under the[pytest]section of yourpytest.ini:[pytest]rabbitmq_port=8888Package resourcesBug tracker:https://github.com/ClearcodeHQ/pytest-rabbitmq/issues
Package: pytest-race
https://github.com/idlesign/pytest-raceDescriptionRace conditions tester for pytestIntroducesstart_racefixture to run race condition tests.RequirementsPython 3.7+pytest 2.9.0+UsageYou can usestart_racefixture in your tests as follows:fromtimeimportsleepACCUMULATOR=0# This global var is race conditions prone.deftest_race(start_race):fromrandomimportrandintdefactual_test():globalACCUMULATORincrement=randint(1,10000)accumulator=ACCUMULATORsleep(1)# Simulate some lag.ACCUMULATOR+=increment# By that moment ACCUMULATOR should have been updated# by another thread. Let's try to prove it.# Using simple `assert` as usual for pytest.assertaccumulator+increment==ACCUMULATOR# Let's run `actual_test` in 2 threads.start_race(threads_num=2,target=actual_test)start_raceaccepts the following arguments:threads_num- number of threads to run simultaneously.target- actual test callable to run in threads.
Package: pytest-rage
pytest plugin to implement PEP712Usageinstall/update via:pip install -U pytest-rageand to run tests type:py.testif more than 7 tests fails fffffffuuuuu happens :)NotesThe official repository of this plugin is athttp://github.com/santagada/pytest-rageFor more info on py.test seehttp://pytest.orgBased on PEP712:http://www.revsys.com/blog/2011/oct/20/pep712-proposal-make-unittest2-more-accurate/
Package: pytest-raisesregexp
I really missedassertRaisesRegexpin unittest module frompytest,
so I wrote this simple plugin.Usage# some_module.pyclassExpectedException(Exception):passdeffunction_to_test():raiseExpectedException('error message: 1560')# test_some_module.pyfrompytestimportraises_regexpfromsome_moduleimportfunction_to_test,ExpectedExceptiondeftest_something_to_test():withraises_regexp(ExpectedException,r".* 1560"):function_to_test()Installation$pipinstallpytest-raisesregexpIt installs as a pytest entry point, so you can:frompytestimportraises_regexpLICENSEMIT license
Copyright (c) 2013-2015 Kiss György
Package: pytest-raisin
pytest-raisinPlugin putting a higher-level interface topytest.raises.
It allows to use an exceptioninstanceas the expected value, which would be compared with the actual exception (if any) based upon the type and theargsattribute.# Old-skool:withpytest.raises(SystemExit)ascm:sys.exit(1)assertcm.value.args==(1,)# New hotness:withpytest.raises(SystemExit(1)):sys.exit(1)More sophisticated comparisons can be registered for user-defined error subclasses if necessary (seeAdvanced Usage).Installationpipinstallpytest-raisinBasic UsageUsage in your tests looks like this>>>currant_exchange_rates={..."sultana":50,..."raisins":100,...}>>>withpytest.raises(KeyError("grape")):...currant_exchange_rates["grape"]...>>>withpytest.raises(KeyError("sultanas")):...currant_exchange_rates["prunes"]...AssertionError:KeyErrorargsdonotmatch!Actual:('prunes',)Expected:('sultanas',)>>>withpytest.raises(KeyError("Carlos Sultana")):...currant_exchange_rates["sultana"]Failed:DIDNOTRAISEKeyError('Carlos Sultana')The plugin is enabled by default:pytest.raisesis monkeypatched with the new functionality directly. To temporarily execute without the new stuff, usepytest-pno:pytest-raisin.The various legacy forms ofpytest.raiseswill continue to work, falling back to the original implementation.Advanced UsageIn most use-cases, the default behaviour of considering exceptions to be equivalent if theargsattributes have matching tuples should be satisfactory.
However, some 3rd-party exception classes have additional logic inside them (e.g. Django’sValidationError) and you might want to provide a more custom assertion here.Plugin users may register their own errors/callables via pytest-raisin’s decorator factory:@pytest.register_exception_compare(MyError)defmy_error_compare(exc_actual,exc_expected):...Your comparison function will be called with the argumentsexc_actualandexc_expected, which willbothbe directly instances ofMyError(the test will have failed earlier if the type was not an exact match). This function should inspect the instances and raise anAssertionErrorwith useful context message should they be considered not to match. It should do nothing (i.e. returnNone) if the exceptions should be considered equivalent.Note:An instance of a subclass isnotpermitted when using an exception instance as the argument topytest.raises. If you want to allow subclassing, use the original syntax of passing the type.