Saravanan666/pypi-org huggingface dataset:
Package: pytest-subinterpreter
# pytest-subinterpreterA Pytest extension for running the pytest session inside a [sub interpreter](https://peps.python.org/554). This extension is mainly targeted for Python extension library maintainers that want to verify their existing test suite works inside a sub interpreter.Requirements:Python 3.13.0-alpha.2 or abovePytest 7 or above## Installation`console pip installpytest-subinterpreter`## UsageThe extension arguments are:–interpreter-perDefaults tosession(also the only option at the moment).`console pytest  tests/test_simple.py `
Package: pytest-subtesthack
A hack to explicitly set up and tear down fixtures.This terrible plugin allows you to set up and tear down fixtureswithinthe
test function itself. This is useful (necessary!) for usingHypothesisinside py.test, as hypothesis will
call the test function multiple times, without setting up or tearing down
fixture state as is normally the case.Installation:pip install pytest-subtesthack…though the plugin is 32 lines of code, consider vendoring it.Seetest_example.pyfor usage.
Package: pytest-subtests
unittestsubTest()support andsubtestsfixture.Thispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesAdds support forTestCase.subTest.Newsubtestsfixture, providing similar functionality for pure pytest tests.InstallationYou can installpytest-subtestsviapipfromPyPI:$ pip install pytest-subtestsUsageunittest subTest() exampleimportunittestclassT(unittest.TestCase):deftest_foo(self):foriinrange(5):withself.subTest("custom message",i=i):self.assertEqual(i%2,0)if__name__=="__main__":unittest.main()Outputλ pytest .tmp\test-unit-subtest.py
======================== test session starts ========================
...
collected 1 item

.tmp\test-unit-subtest.py FF.                                  [100%]

============================= FAILURES ==============================
_________________ T.test_foo [custom message] (i=1) _________________

self = <test-unit-subtest.T testMethod=test_foo>

    def test_foo(self):
        for i in range(5):
            with self.subTest('custom message', i=i):
>               self.assertEqual(i % 2, 0)
E               AssertionError: 1 != 0

.tmp\test-unit-subtest.py:9: AssertionError
_________________ T.test_foo [custom message] (i=3) _________________

self = <test-unit-subtest.T testMethod=test_foo>

    def test_foo(self):
        for i in range(5):
            with self.subTest('custom message', i=i):
>               self.assertEqual(i % 2, 0)
E               AssertionError: 1 != 0

.tmp\test-unit-subtest.py:9: AssertionError
================ 2 failed, 1 passed in 0.07 seconds =================subtestsfixture exampledeftest(subtests):foriinrange(5):withsubtests.test(msg="custom message",i=i):asserti%2==0Outputλ pytest .tmp\test-subtest.py
======================== test session starts ========================
...
collected 1 item

.tmp\test-subtest.py .F.F..                                    [100%]

============================= FAILURES ==============================
____________________ test [custom message] (i=1) ____________________

    def test(subtests):
        for i in range(5):
            with subtests.test(msg='custom message', i=i):
>               assert i % 2 == 0
E               assert (1 % 2) == 0

.tmp\test-subtest.py:4: AssertionError
____________________ test [custom message] (i=3) ____________________

    def test(subtests):
        for i in range(5):
            with subtests.test(msg='custom message', i=i):
>               assert i % 2 == 0
E               assert (3 % 2) == 0

.tmp\test-subtest.py:4: AssertionError
================ 2 failed, 1 passed in 0.07 seconds =================ContributingContributions are very welcome. Tests can be run withtox:tox -e py37LicenseDistributed under the terms of theMITlicense, “pytest-subtests” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-subunit
pytest-subunit is a plugin forpy.testthat generates output in subunit format.RequirementsPlugin was tested on Python 2.7 and 3.5, and requires:pytest 2.6.4 or newerpython-subunit 1.2 or newerInstallationTo install pytest-subunit:$ pip install pytest-subunitThen run your tests with subunit output:$ py.test --subunit
Package: pytest-sugar
pytest-sugar ✨This plugin extendspytestby showing failures and errors instantly, adding a progress bar, improving the test results, and making the output look better.InstallationTo install pytest-sugar:python -m pip install pytest-sugarOnce installed, the plugin is activated automatically. Run your tests normally:pytestIf you would like more detailed output (one test per line), then you may use the verbose option:pytest --verboseIf you would like to run tests without pytest-sugar, use:pytest -p no:sugarHow to contribute 👷‍♂️Make sure to read ourCode of Conduct. You can get started modifying the codebase with the following commands. Alternatively, you can try Github Codespaces (click the badge above). Push the changes to your repository & create a pull request.git clone git@github.com:Teemu/pytest-sugar.git
cd pytest-sugar
python -m venv .venv
source .venv/bin/activate
echo ".venv" >> .git/info/exclude
pip install -e ".[dev]"
pre-commit installThere are two ways of running tests. We have our proper tests:pytest .There are also fake tests that can be used to visualise the output:pytest faketestsWhen submitting a pull request, please add aRELEASE.mdfile in the root of the project that contains the release type (major, minor, patch) and a summary of the changes that will be used as the release changelog entry. For example:Release type: patch

For long-running tests, display minutes and not only seconds.RequirementsYou will need the following prerequisites in order to use pytest-sugar:Python 3.8 or newerpytest 6.2 or newerRunning on WindowsIf you are seeing gibberish, you might want to try changing charset and fonts. Seethis commentfor more details.Similar projectspytest-richpytest-pretty
Package: pytest-suitemanager
A simple plugin to use with pytestThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-suitemanager” viapipfromPyPI:$ pip install pytest-suitemanagerUsageTODOContributingContributions 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 theBSD-3license, “pytest-suitemanager” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-suite-timeout
pytest-suite-timeoutA pytest plugin for ensuring max suite time.Really though, it's: if the timeout expires, no new tests are started.A use caseWorks great in conjunction withpytest-repeat.Say your debugging a flaky test and just want to run it a bunch of times, but not longer than say 10 minutes (600 seconds).After installing bothpytest-repeatandpytest-suite-timeoutyou can say:$ pytest test_something.py::test_func --count=1000 --suite-timeout=600That will run a test 1000 times, if that's less than 600 seconds.
If it takes longer than 600 seconds, it will stop running new tests after 600 seconds.InstallationFrom PyPI:$ pip install pytest-suite-timeoutUsageSpecify the max suite time with--suite-timeout, in seconds (float).Example of max 90 seconds:$ pytest --suite-timeout=90Defaults to no timeoutIf you don't pass in--suite-timeout, nothing happens.Timeout behaviorTimeout is done between tests.
If a timeout is noticed,pytest.exit()is called, stopping all further testing.ContributingContributions are welcome. Tests can be run withtox.
Test coverage is now 100%. Please make sure to keep it at 100%.
If you have an awesome pull request and need help with getting coverage back up, let me know.LicenseDistributed under the terms of theMITlicense, "pytest-suite-timeout" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.ChangelogSeechangelog.md
Package: pytest-super-check
Unmaintained (2022-12-07)I stopped maintaining this package as it has never been popular.
I think it would be better to use a lint rule to enforce callingsuper()in test cases.Pytest plugin to check your TestCase classes call super in setUp, tearDown,
etc.FeaturesThis plugin checks allTestCaseclasses in your test suite to ensure that
theirsetUp,tearDown,setUpClass,tearDownClass, andsetUpTestData(Django extension) methods all callsuper(). You might
care about this when you have extensions to these methods in your project
specific base class that when skipped (by accidentally missingsuper()),
cause subtle bugs.AboutI 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 someTestCaseclasses didn’t callsuper()in e.g.setUp, which caused the tests to fail, or incorrectly
pass, in rather subtle ways. This problem is exacerbated by Django’ssetUpetc. doing magic around not requiringsuper()to be called. Our solution
was to just ensure everyTestCasealways callssuper()in those
methods. This is a Pytest port of that plugin.InstallationInstall with:python-mpipinstallpytest-super-checkPython 3.7 to 3.11 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 and use the plugin. Test discovery will then
blow up if any subclasses ofunittest.TestCaseare found that havesetUpetc. methods that don’t callsuper().You can disable the plugin by passing the options-pno:super_checktopytest.
Package: pytest-symbols
Overviewpytest-symbols is a pytest plugin that adds support for passing test
environment symbols into pytest tests.The supported formats for symbols files are json and yaml.Installationpipinstallhttps://github.com/F5Networks/pytest-symbols.gitUsageuse the “–symbols” option to pass symbols into a pytest run:py.test--symbolstests/demo.json--tests/demo.pyuse the “symbols” fixture to access symbols within a test:deftest_with_symbols_fixture(self,symbols):printsymbolsassertsymbols.client_ip=="192.168.1.1"assertsymbols.server_ip=="192.168.2.1"use “pytest.symbols” to access symbols outside the “symbols” fixture:importpytestfrompytestimportsymbolsasfoodeftest_without_symbols_fixture(self):printpytest.symbolsassertsymbols.client_ip=="192.168.1.1"assertsymbols.server_ip=="192.168.2.1"printfooassertfoo.client_ip=="192.168.1.1"assertfoo.server_ip=="192.168.2.1"Documentationhttps://pytest-symbols.readthedocs.orgHow to ContributeContributions are warmly welcomed.Contributions should be associated with an open issue.Find an open issue that interests you, or create a new one if you
don’t find what you’re looking for in the backlog.Fork this repository on GitHub and make your changes in the master
branch (or branch off of it).Write tests that verify the issue has been resolved (ie. the bug was
fixed or the new feature works as expected).Add yourself to AUTHORS.rst.Send a pull request.Sit back and wait for the plaudits to roll in.Contactqetools@f5.comSupportSeeSupportCopyrightCopyright 2016 F5 Networks Inc.Contributor License AgreementIndividuals or business entities who contribute to this project must
have completed and submitted theF5 Contributor License
AgreementtoOpenstack_CLA@f5.comprior to their code submission being included
in this project.LicenseApache V2.0Licensed under the Apache License, Version 2.0 (the “License”); you may
not use this file except in compliance with the License. You may obtain
a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: pytest-system-statistics
What is Pytest System StatisticsIt’s apytestplugin, extracted frompytest-salt-factories,  which tracks the test
suite CPU and memory usage and, optionally, includes a report section including that data,
for example:test_proc_sys_stats.py::test_one PASSED                                                [100%]
----------------------------------- Processes Statistics ------------------------------------
  .......... System - CPU: 17.80 %  MEM: 29.70 % (Virtual Memory)  SWAP:  12.80 %
  .. Test Suite Run - CPU:  0.00 %  MEM:  0.05 % (RSS)  MEM SUM: 0.09 % (RSS)  CHILD PROCS: 2
  ...... FooProcess - CPU:  0.00 %  MEM:  0.02 % (RSS)  MEM SUM: 0.03 % (RSS)  CHILD PROCS: 1

==================================== 1 passed in 0.34s ======================================InstallInstalling Pytest System Statistics is as simple as:python-mpipinstallpytest-system-statisticsUsageControlling the behaviour of the plugin is made through flags which are passed topytest.--sys-stats             Print System CPU and MEM statistics after each test execution.
--no-sys-stats          Do not print System CPU and MEM statistics after each test execution.
--sys-stats-no-children Don't include child processes memory statistics.
--sys-stats-uss-mem     Use the USS("Unique Set Size", memory unique to a process which
                        would be freed if the process was terminated) memory instead which
                        is more expensive to calculate.Tracking Additional ProcessesTo include additional processes to track and report statistics against, simply add it to the
session scopedstats_processesfixture, for example:@pytest.fixturedefmy_server_process(stats_processes):proc=subprocess.Popen(...)stats_processes.add("MyServerProcess",proc.pid)try:yieldprocfinally:stats_processes.remove("MyServerProcess")ContributingThe pytest-system-statistics project team welcomes contributions from the community.
For more detailed information, refer toCONTRIBUTING.DocumentationThe full documentation can be seenhere.
Package: pytest-system-test-plugin
Pyst - Pytest System-Test PluginNote: This plugin is the state experimental / techdemo !This plugin should ease system-testing with Pytest.
To achieve this it provides a simple interface to
manage processes in the operating system like starting them,
running background processes and evaluating the output.This is especially useful to prepare the system for a test
(e.g. start background prcesses, databases, servers, ...) and then
run the programm under test in a blackbox-manner.Features should be (intended, partly unfinished):DONE: Starting, stopping and managing processes in the OSDONE: Pysys like interface to run systemtestsEspecially startProcess and assertGrepDONE: Logs all outputs to files and can later on run assertions on that outputsShould work:DONE: Start and stop processes with and without sudoPrepare configuration files for executablesDONE: Simple user fixturesProvides envioronment fixtures / group fixtures / environments (terminology
depends on the framework you are used to).Multistage environments fixturesSupports you to write your own fixuresSo far, this will only un on unix-like systems.Preparepython3 -m venv env-plugin
source env-plugin/bin/activate
pip install pytest
pip install pytest-mock
pip install restapi_echo_server
or
pip install -r requirements.txtUsageHave a look attests/test_use_cases.pyit
contains some exemplary use-cases.
We use an echo-server and curl to be near to real use cases. More will be added
soon.ExampleSome other use cases are herehttps://github.com/abelikt/pytest_system_test_plugin_testimport re
import pytest

def test_use_rolldice(process_factory):
    """This test installs a package via the package management, uses
    it and removes it again.
    """

    # make sure it is not installed
    call = process_factory(["whereis", "rolldice"])
    call.run()
    assert call.get_stdout() == "rolldice:"
    assert call.returncode == 0

    # Install package
    install = process_factory(["sudo", "apt-get", "install", "-y", "-q", "rolldice"])
    install.run()
    assert install.returncode == 0

    # Call and check output against a regex
    call = process_factory(["rolldice", "6"])
    call.run()
    print(call.get_stdout())
    print(call.get_stderr())

    # match a single digit
    assert re.match(r"^\d$", call.get_stdout()) is not None
    assert call.returncode == 0

    # deinstall it
    deinstall = process_factory(["sudo", "apt-get", "remove", "-y", "-q", "rolldice"])
    deinstall.run()
    assert install.returncode == 0Testpip install .; python -m pytest -s --log-cli-level=INFO
tox
tox -e {lint, linttest}Measure test executionpip install .; python -m pytest -s --log-cli-level=INFO --junitxml=junit.xml
xmllint junit.xml --format > junitf.xmlLinksThis repo:https://gitlab.com/bitmuster/pytest_system_test_pluginhttps://github.com/bitmuster/pytest_system_test_pluginSome exemplary tests:https://github.com/abelikt/pytest_system_test_plugin_testPytest test-framework:https://docs.pytest.orgPySys test-framework:https://pysys-test.github.io/pysys-testSimilar plugins:https://github.com/pysys-test/pysys-testhttps://github.com/CS-SI/pytest-executable
Package: pytest_tagging
pytest-taggingpytestplugin that allows tagging tests using arbitrary strings.It supports selecting only tests with a specific tag, and displays a counter of how many tests failed
for each specific tag.This package exists because doing all of this withpytest.markis painful, since it requires registering marks,
and you cannot use variables defined elsewhere easily.Usage@pytest.mark.tags("JIRA-XX","integration",constants.COMPONENT_X)deftest_foo():assertFalseInvocation:pytest--tagsintegration--tagsMY_COMPONENT_NAMEBy default, all tests that match at least one tag will be collected. To only select
tests that have all the provided tags, use the option --tags-operand=AND, like so:pytest--tagsintegration--tagsMY_COMPONENT_NAME--tags-operandANDYou can also display all available tags by specifyin--tagsempty:pytest--tags
>>Availabletags:
>>foo
>>barTags can be combined usingpytest_tagging.combine_tags:frompytest_taggingimportcombine_tags
combine_tags("all","foo","bar")Then you can executepytest --tags alland it will run all tests withfooandbartagsExtraIt is thread-safe, so it can be used withpytest-parallel.
Package: pytest-tap
pytest-tap is a reporting plugin for pytest that outputsTest Anything Protocol (TAP)data.
TAP is a line based test protocol for recording test data in a standard way.Usepytest--tapafter installing to get started.FollowGitHubfor more information or to follow this plugin’s development.
Additional developer documentation about Python and TAP is onRead the Docs.ReleasesVersion 3.4, July 15, 2023Deprecate--tap-streamin favor of--tapfor streaming mode.When using xdist, report the plan at the beginning of execution.Add support for Python 3.11.Drop support for Python 3.7 (it is end-of-life).Drop support for Python 3.6 (it is end-of-life).Drop support for PyPy.Version 3.3, October 27, 2021Add support for Python 3.10.Fix bug with help printing when streaming mode is enabled (#59).Drop support for Python 3.5 (it is end-of-life).Remove unmaintained (and likely inaccurate) locale info.Version 3.2, November 7, 2020Add support for Python 3.8.Add support for Python 3.9.Handleunittest.expectedFailureandpytest.xfailin a way that is more consistent
with the TAP specification.Version 3.1, Released March 25, 2020Fix reporting that was broken by the removal
of a deprecated feature in pytest 5.4.Version 3.0, Released January 28, 2020Drop support for Python 2.Version 2.5, Released December 26, 2019Last supported version for Python 2.Pin tap.py to a version range that supports Python 2.Version 2.4, Released October 21, 2019Handle failures that occur from setup.
This will catch errors that may happen in fixtures.Drop support for Python 3.4 (it is end-of-life).Add support for Python 3.7.Version 2.3, Released September 16, 2018Improve xfail handling.
Honor strict xfail mode.
Use TODO instead of SKIP directive to better align with TAP specification.Output the plan line (1..N) first.Version 2.2, Released January 9, 2018Update output format to match closer to pytest styling.Drop support for Python 3.3 (it is end-of-life).Version 2.1, Released August 12, 2017Add support for Python 3.6.Fix crash when running with pytest-xdist (#27).Version 2.0, Released August 1, 2016Update to tap.py 2.0.
This update drops the indirect dependencies on nose and pygments.Improve handling of skips and xfails.Suppress# TAP results for TestCasefor streaming.
This header makes little sense for pytest’s test function paradigm.
Including the header generated extra noise for each function.Drop support for Python 2.6Version 1.9, Released June 11, 2016Initial release as stand-alone plugin.
The version number aligns with tappy.
Package: pytest-tape
Easy assertion with expected results saved to yaml files.FeaturesCreates yaml files for expected test results , a.k.a. tape.Creates separate tape for each test file. Each tape stores results for all tests that have utilised tape fixture.supports parametrized tests, as long as all parameters can be jsonified.Hash functions are used to store and identify params.Expected results are stored as dictionaries in yaml, so that they can be compared using tolerances.Requirementspython >= 3.6InstallationYou can install “pytest-tape” viapipfromPyPI:$ pip install pytest-tapeUsageJust usetapefixture in any of the tests and assert dictionary of results with it.deftest_correctness(tape):result_of_calc={'a':[1,2,3],'b':'Another_Random_Result','c':45.99}asserttape==result_of_calcFirst time the tests fails, tape writes to yaml file.
Second and all subsequent times you run the test - it compares the result with what is on tape.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-tape” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.AcknowledgmentsThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.
Package: pytest-tblineinfo
Introductionpytest-tblineinfois apy.testplugin that insert the node id in
the final py.test report when--tb=lineoption is used.RationaleBy default in the--tb=linemode, py.test only report the python
file and line where the assertion occurs. When the exception occurs in
an helper or plugin function, it is not easy to relate the error with a
test.This plugin is intended to resolve this issue.Installationpip install pytest-tblineinfoUsageSimply call py.test with--tb=lineonce the plugin is installed, and
the end report ofpy.testwill prefix the errors with the test name.ContributingSources are available either on bitbucket (mercurial repo) or github
(git repo):https://github.com/matclab/pytest-tblineinfohttps://bitbucket.org/matclab/pytest-tblineinfoPull request are welcomed !