Saravanan666/pypi-org huggingface dataset:
Package: pytest-rerun-all
pytest-rerun-allRerun whole testsuites for a certain time or amountStill under development.Arguments--rerun-time <time>Rerun testsuite for the specified time, argument as text (e.g"2 min","3 hours", ...), the default unit is seconds.--rerun-iter <int>Rerun testsuite for the specified iterations.--rerun-delay <time>After each testsuite run wait for the specified time, argument as text (e.g"2 min",10, ...), the default unit is seconds.--rerun-freshStart each testsuite run withfreshfixtures (teardown all fixtures), per default no teardown is done if not needed.NOTE:All arguments can also be set as environment variables, e.g.RERUN_TIME="1 hour".Examplespytest--rerun-time"10 min"examples# run tests for 10 seconspytest--rerun-iter10examples# run all tests 10 times# run all tests 10 times and teardown all fixtures after each runpytest--rerun-iter10--rerun-teardownexamples# run tests for 2 hours with 10 secons delay after each runpytest--rerun-time"2 hours"--rerun-dealy"10s"examples# run tests for 120 seconds with a fresh restart for each testsuite runRERUN_FRESH=1pytest--rerun-time120examplesInstallationYou can installpytest-rerun-allviapipfromPyPIor thisrepo:pipinstallpytest-rerun-all
pipinstallgit+git@github.com:TBxy/pytest-rerun-all.git@main# latest versionTodosFixture to exclude tests from running more than once (e.g.@pytest_rerun_all.only_once())Issue with only one selected test (teardown on frist run)Output for each new runSummary per test with number of fails and pass (maybe only for failed tests ...)Write testsGithub ActionsContributingContributions are very welcome.
Tests are not ready at the moment, use the example scripts.LicenseDistributed under the terms of theMITlicense,pytest-rerun-allis 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-resilient-circuits
pytest-resilient-circuitsThis package is apytestplugin that provides fixtures to facilitate testing IBM SOAR apps.Installing this moduleTo install from PyPi:pip install pytest-resilient-circuitsLicense and TermsCopyright © IBM Corporation 2023Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
Package: pytest-resource
Load resource fixture plugin to use with pytestThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-resource” viapipfromPyPI:$ pip install pytest-resourceUsageTODOContributingContributions 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-resource” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-resource-usage
pytest-resource-usageAdd running times and peak memory usage of tests to the output ofpytest. Two ways of measuring memory usage are
implemented. The first usestracemalloc, which is unaffected by
swapping. Sincetracemallocis a standard library, this way of
measuring introduces no dependencies beyondpytest. However, measuring
withtracemalloccan have a high overhead. The other way of measuring
memory usage is by means of sampling the unique set size. This method
has lower overhead, but can be less accurate and is only available if
thepsutilpackage is installed.Thepytest-resource-usagepackage is intentionally kept fairly simple.
If you want something more feature-rich and ambitious, you should usepytest-monitor.Example usageReporting is triggered by the presence of one or more of the following markers:report_duration,report_tracemalloc,report_uss(requirespsutil).fromtimeimportsleepimportpytest@pytest.mark.report_durationdeftest_sleep():sleep(99)@pytest.mark.report_uss@pytest.mark.report_tracemalloc@pytest.mark.report_duration@pytest.mark.parametrize("elements",[2_000_000,1_000_000])deftest_tracemalloc_overhead(elements):_=list(range(elements))@pytest.mark.report_uss(interval=0.01)@pytest.mark.report_durationdeftest_unique_set_size():_=list(range(1_000_000))@pytest.mark.report_durationdeftest_no_overhead():_=list(range(1_000_000))Running the above tests produces the followingpytestoutput.================================================================ test session starts =================================================================
plugins: pytest-resource-usage-1.0.0
collected 5 items                                                                                                                                    

tests/test_readme.py .....                                                                                                                     [100%]

=================================================================== resource usage ===================================================================
tests/test_readme.py::test_sleep (call) running time: 0:01:39
tests/test_readme.py::test_tracemalloc_overhead[2000000] (call) peak allocated memory: 72MB, peak unique set size: 243MB, running time: 0.627 seconds
tests/test_readme.py::test_tracemalloc_overhead[1000000] (call) peak allocated memory: 36MB, peak unique set size: 115MB, running time: 0.329 seconds
tests/test_readme.py::test_unique_set_size (call) peak unique set size: 25.7MB, running time: 0.047 seconds
tests/test_readme.py::test_no_overhead (call) running time: 0.020 seconds
=========================================================== 5 passed in 100.13s (0:01:40) ============================================================
Package: pytest-responsemock
https://github.com/idlesign/pytest-responsemockDescriptionSimplified requests calls mocking for pytestProvidesresponse_mockfixture, exposing simple context manager.Any request under that manager will be intercepted and mocked according
to one or morerulespassed to the manager. If actual request won’t fall
under any of given rules then an exception is raised (by default).Rules are simple strings, of the pattern:HTTP_METHOD URL->STATUS_CODE :BODY.RequirementsPython 3.7+UsageWhen this package is installedresponse_mockis available forpytesttest functions.deffor_test():returnrequests.get('http://some.domain')deftest_me(response_mock):# Pass response rule as a string,# or many rules (to mock consequent requests) as a list of strings/bytes.# Use optional `bypass` argument to disable mock conditionally.withresponse_mock('GET http://some.domain -> 200 :Nice',bypass=False):result=for_test()assertresult.okassertresult.content==b'Nice'# mock consequent requestswithresponse_mock(['GET http://some.domain -> 200 :Nice','GET http://other.domain -> 200 :Sweet',]):for_test()requests.get('http://other.domain')Use withpytest-datafixtures:deftest_me(response_mock,datafix_read):withresponse_mock(f"GET http://some.domain -> 200 :{datafix_read('myresponse.html')}"):...Describe response header fields using multiline strings:withresponse_mock('''
    GET http://some.domain

    Allow: GET, HEAD
    Content-Language: ru

    -> 200 :OK
    '''):...Test json response:response=json.dumps({'key':'value','another':'yes'})withresponse_mock(f'POST http://some.domain -> 400 :{response}'):...To test binary response pass rule as bytes:withresponse_mock(b'GET http://some.domain -> 200 :'+my_bytes):...Access underlying RequestsMock (fromresponsespackage) asmock:withresponse_mock('HEAD http://some.domain -> 200 :Nope')asmock:mock.add_passthru('http://other.domain')
Package: pytest-responses
Automatically activate responses across your py.test-powered test suite (thus preventing HTTP requests).$pipinstallpytest-responsesIf particular tests need access to external domains, you can use thewithoutresponsesmarker:@pytest.mark.withoutresponsesdeftest_disabled():withpytest.raises(ConnectionError):requests.get('http://responses.invalid')assertlen(responses.calls)==0Additionally, you can use the responses fixture:deftest_enabled(responses):withpytest.raises(ConnectionError):requests.get('http://responses.invalid')assertlen(responses.calls)==1
Package: pytest-restrict
Pytest plugin to restrict the test types allowed.FeaturesThis plugin allows you to restrict the test types allowed to ensure they inherit from one of a given list of classes.
Useful on projects where you have custom test classes that developers may forget about.InstallationInstall with:python-mpipinstallpytest-restrictPython 3.8 to 3.12 supported.Testing a Django project?Check out my bookSpeed Up Your Django Testswhich covers loads of ways to write faster, more accurate tests.UsagePytest will automatically find the plugin and use it when you runpytest, however by default there are no restrictions.
To restrict the test types, provide--restrict-typesas a comma-separated list of import paths to allowed test base classes.
The import paths are passed topkgutil.resolve_name(), for which you should prefer the form<module.path>:<classname>.
It’s best to set--restrict-typeswithinaddoptsin your pytest configuration file.For example, to restrict tests to Django’stest case classeswithinpytest.ini:[pytest]addopts=--restrict-types django.test:SimpleTestCaseTo allow function tests and other non-class test types (such as doctests), provide the special string “None”:[pytest]addopts=--restrict-types None,django.test:SimpleTestCaseHistoryI developed this feature in a closed source Nose plugin whilst working on the big Django project at YPlan.
We had some custom enhancements and fixes on top of the Django test classes, but developers sometimes forgot about using them and instead used the built-inunittestclasses, or the plain Django ones.
Our solution was to just make the test runner error if it encountered non-whitelisted test types.This package is a pytest port of that plugin.
Package: pytest-result-log
pytest-result-log摘要pytest-result-log是一个在日志文件中记录每个用例的开始、结束和结果信息的pytest插件。预览pytest-result-log是sanmu框架孵化的第三个pytest插件，通过hook钩子的方式，可以准确判断所有类型的用例执行结果，并记录到日志文件中，效果如下安装执行命令pip install pytest-result-log启用修改配置文件pyetst.ini[pytest]log_file=pytest.loglog_file_level=infolog_file_format=%(levelname)-8s %(asctime)s [%(name)s:%(lineno)s]  : %(message)slog_file_date_format=%Y-%m-%d %H:%M:%S文档专栏：《pytest-result-log》pytest-result-log：把用例执行结果保存到日志的 pytest 插件pytest-result-log：配置说明及示例
Package: pytest-rethinkdb
warning: Scaffolding only. Not Yet Implemented!pytest-rethinkdbA RethinkDB plugin for pytest.FeaturesTODORequirementsTODOInstallationYou can install “pytest-rethinkdb” viapipfromPyPI:$ pip install pytest-rethinkdbUsageTODOContributingContributions 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-rethinkdb” is free
and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed
description.Special ThanksThisPytestplugin was started withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.
Package: pytest-reverse
Pytest plugin to reverse test order.InstallationInstall with:python-mpipinstallpytest-reversePython 3.8 to 3.12 supported.Testing a Django project?Check out my bookSpeed Up Your Django Testswhich covers loads of recommendations to write faster, more accurate tests.
I created pytest-reverse whilst working on the book!UsagePytest will automatically find the plugin and use it when you runpytest.
You can reverse test order by passing the--reverseflag:pytest--reverseYou can make this always apply by adding it to theaddoptssetting in yourpytest.ini(orother configuration
file):[pytest]addopts=--reverseHistoryI’m the creator and maintainer ofpytest-randomly, a plugin
for randomly ordering tests. @thbde opened an issue there pointing to the paperEmpirically revisiting the test independence
assumption, which covers
test reordering techniques. It turns out that reversal is nearly as effective
as randomization.Test reversal is availablein Django’s test
runner.
I figured such an option or plugin would exist for pytest already, but it
didn’t, so I made it here.
Package: pytest-rich
Leveragerichfor richer test session output.This plugin is not published to PyPI yet.IMPORTANT: Proof-of-conceptThis plugin is mostly a proof of concept and islooking for a maintainerwhich wants to adopt it.The plugin currently outputs this:There’s definitely room for improvement, and the new maintainers are free to improve on that or even change it completely.I intend toinitiallyadd people as maintainers to this repository, and after a while eventually transfer it to another account.The reason is that I played a bit with it and see promise in a fullpytest+richintegration, but I don’t have
the bandwidth to maintain yet another pytest plugin, so I’m opening the code to the community in the hope that someone
picks it up and gives it the treatment it deserves.If you are interested, feel free to open an issue.LicenseDistributed under the terms of theMITlicense, “pytest-rich” is free and open source softwareThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.
Package: pytest-richer
Pytest-richerA replacement progress and reporting front end forpytest, usingRichto
provide enhanced output.StatusThe most recent release is 0.1.1.This isalphasoftware. Probably quite robustalphasoftware (I use it all
the time), but there will bepytestoptions that cause it to fail or behave
weirdly.Please try it and raise issues if you have problems. I intend to check daily
and fix things quickly.Getting startedInstall from PyPi using pip, for example:python -m pip install --user pytest-richerClone this repository and install usingpip, For example:python -m pip install --user pytest-richerNoteThis was inspired bypytest-rich, but is incompatible with it. If you havepytest-richinstalled, you will need to uninstall it first.UsingUse the--richcommand option when you invokepytest.See--helpfor additionalrich-options.FeaturesDetailed per-file/per directory progress display.Per-file view is used for preference.Per directory view is used when the number of files becomes unwieldy.Works very well withpytest-xdistWhenpytest-xdistis enabled, the progress display stays the same,
rather than switching to a simplified form.Collection errors cause run to stop instead of being ignored.Error reporting formatting is unaffected bypytest-xdist.Order of error reports are not affected bypytest-xdist.Richis used to format the details of collection and test execution errors.Arguably more human parseable error reports (at least I think so;
suggestions for improvements welcome).In particular, collection error reports are easier to read.Additional information displayed.pytest-xdistoutput displayed as part of progress display.Slow setup and teardown phases are visible on the progress display.Setup and teardown errors separately identified on the progress display
and in the final summary.Number of activepytest-xdistworkers (parallel test count) shown.Some other notable differences from the standardpytestreporter.Collection error details are reported when the--no-summaryoption is
used.Tracebacks are not as compact when the--tb=shortoption is used. This
may change in the future, but is currently not practicable.Long tracebacks include context lines after the failure line. This
may change in the future, but is currently not practicable.Long tracebacks only show 3 lines of context before the failure line;pytestshows all preceding lines within the function.There will undoubtedly be other differences and missing standard features at
this stage. Please raise an issue for any problems.CreditsThis was inspired bypytest-rich.
Package: pytest-rich-reporter
pytest-rich-reporterA pytest plugin usingRichfor beautiful test result formatting.DisclaimerThis project is a hobby project that is being used as an opportunity to learn Rich, custom Pytest plugin creation, and modern Python package development.It is currently in an ALPHA state. It is not intended for production use.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-rich-reporter" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-richtrace
pytest-richtraceA pytest plugin that dumps the stages of the pytest testing process to the terminal.It usesrichto add formatting to the output.InstallationInstall using pippipinstallpytest_richtraceUsageTo activate the plugin add the--rich-traceoption to thepytestcommand line.Sample outputFull test runQuiet outputpytest--rich-trace-qNormal outputpytest--rich-traceVerbose outputpytest--rich-trace--verbose--collect-only outputpytest--rich-trace--collect-only
Package: pytest-ringo
# pytest-ringoHelper fixtures to test web applications using the Ringo web framework## FixturesThis plugin provides the following fixtures:1. **app** A *TestApp* instance from *webtest* of the application. Scope is "module".1. **config** The config object used to configure route etc. Scope is "module".1. **apprequest** A *DummyRequest* from *Pyramid* to be used to call views. No scope.## HelpersThis plugin provides the following helper methods. Please consult the sourceto see how  to use the methods:### Transactions1. **transaction_begin** Begin a new transaction for a testcase1. **transaction_rollback** Rollback the currently running transaction### Usecases1. **login** Login a given user### Getting data1. **get_data** A helper methods to get data from the application using theREST API.1. **search_data** A helper methods to search for a specific item in thedatabase using the using theREST API.1. **get_max_id** Get the max id of a table in the database (usefull to getthe id of the last insererted item) using the REST API.## InvokeYou need to provide the URL to the .ini file when invoking the pytest command::py-test --app-config="path/to/config.ini"
Package: pytest-rmsis
Pytest Rmsis PluginThis plugin synchronize test reports to Jira RMsis. Following test attributes are synchronized:Run result: passed, failed, skippedDescription of testcaseJira requirementFree software: MIT licenseInstallationpip install pytest-rmsisKonfigurationIn order to synchronize test result with RMsis, you have to specify a few parameters:RMsis User NameRMsis PasswordRMsis URLRMsis Project Name (for example: DLE_RMsis_CI_integration)RMsis Release Name (for example: helbling-test-framework)Optional RMsis Testrun Name (otherwise the Testrun is named: Pytest)These parameters can directly be set in the shell:pytest--rmsis\--rmsis-user<USERNAME>\--rmsis-password<PASSWORD>\--rmsis-urlhttps://jira.example.de:3601\--rmsis-project"My Project"\--rmsis-release"My Release"\--rmsis-testrun"My Testrun"or in thepytest.ini:[pytest]
addopts = --rmsis 
          --rmsis-user <USERNAME> 
          --rmsis-password <PASSWORD> 
          --rmsis-url https://jira.example.de:3601 
          --rmsis-project "My Project" 
          --rmsis-release "My Release" 
          --rmsis-testrun "My Release"The flag --rmsis is the On/Off flag for the synchronisation. So if you don't want to synchronize with RMsis, remove it from the parameter list.All parameters can also be configured by environment variables:RMSIS_USR,RMSIS_PSW,RMSIS_URL,RMSIS_PROJECT,RMSIS_RELEASEandRMSIS_TESTRUN.SynchronisationEach test in pytest has an unique identification based on the file path of the test and the class name and the test name:r/test_sample.py::TestClass::test_one. This unique identifier is used as the name of a testcase. This allows to have a mapping of testcases in RMsis to testcases in pytest.DescriptionThe doc-string of a test is synchronized as description by each pytest execution. The description in Rmsis will be overwritten.deftest_me():"""Description which is synchronized"""assertTruePlanned RequirementsIf a test is marked with@pytest.mark.rmsis_requirement("KEY"), the test case is linked to the planned requirement with the key.@pytest.mark.rmsis_requirement("JRCI-R1")deftest_me():assertTrueIf the key changes in the python test, the old linking will not be deleted in RMsis. It has to be deleted manually.Temporary Disable SynchronizationThe synchronization can be disabled on function-scope:@pytest.mark.skip_rmsisdeftest_me():assertTrueFAQDoes pytest delete testcases in RMsis? - No testcases are deletedWhat happens if a testcase is renamed in pytest? - Pytest will create a new testcase in RMsis. You have to manually delete the old testcase in RMsis.What will happen if a testcase in RMsis is deleted? - Pytest will create a new testcase in RMsisAre steps synchronized to RMsis? - No, native pytest does not support the concept of steps.pytest-stepsis not supported.Can attachements be uploaded to RMsis as result of a testrun? - No, the RMsis API does not support the upload of attachements.RoadmapSynchronization of Categories:@pytest.mark.rmsis_cateogry("category")Overwrite test case name:@pytest.mark.rmsis_testcase("Name of testcase")Porting to Rmsis on Jira Cloud
Package: pytest-rng
pytest-rngpytest-rngprovides fixtures for
ensuring “randomness” in your tests is reproducible
from one run to the next.
It also allows the seed for all tests to be changed if requested,
to help ensure that test successes are not dependent on
particular random number seeds.Use therngfixture to get a pre-seeded random number generator (RNG)
that exposes NumPy’s~numpy.random.mtrand.RandomStateinterface.Use theseedfixture to get an integer seed
that can be used to initialize your own RNG.The following example prints the same four random numbers
every time the test is run.importnumpyasnpdeftest_rectification(rng,seed):print(rng.uniform(-1,1,size=3))print(seed)To use these fixtures, install withpipinstallpytest-rngOnce installed, you can use these fixtures like any other fixture:
addrngorseedto the arguments of a test function or class.Seed generationFor theseedfixture, we generate a seed by doing the following:Concatenate the test’snodeidand asaltvalue, if provided.Hash that string to yield an integer seed.For therngfixture, we also add the string"rng"to thesaltvalue before generating the seed as above.
The seed is used to instantiate a~numpy.random.mtrand.RandomState,
which is returned.NoteWe add"rng"to the salt to ensure that random numbers
are different when using therngfixture
and when manually instantiating aRandomStatewith theseedfixture.saltsaltis a string that is added to the test’snodeidin order to change the seed for all tests.
It is advantageous to change seeds regularly to ensure that
your test suite is robust to different seeds.The salt value can be specified in a configuration file
likesetup.cfgorpytest.ini.[tool:pytest]rng_salt=v0.3.0The salt value can also be specified through the command line.pytest--rng-salt"v0.4.0"The salt value passed through the command line takes precedence
over the value set in the configuration file
so that you can change seeds on-the-fly.See the fulldocumentationfor more details.Release History1.0.0 (August 8, 2019)Initial release ofpytest-rng!
Thanks to all of the contributors for making this possible!