Saravanan666/pypi-org huggingface dataset:
Package: pytest_codeblocks
Test code blocks in your READMEs.This is pytest-codeblocks, apytestplugin for testing code
blocks from README files. It supports Python and shell code.Install withpipinstallpytest-codeblocksand run pytest withpytest--codeblocks=================================testsessionstarts=================================platformlinux--Python3.9.4,pytest-6.2.4,py-1.10.0,pluggy-0.13.1
rootdir:/path/to/directory
plugins:codeblocks-0.11.0
collected56items

example.md.......................[50%]README.md.......................[100%]=================================56passedin0.08s==================================pytest-codeblocks will only pick up code blocks withpythonandsh/bash/zshsyntax highlighting.Marking code blocksIt is possible to usepytest.markfor marking code blocks. For example,
to skip a code block usepytest.mark.skiporpytest.mark.skipif:Lorem ipsum

<!--pytest.mark.skip-->```pythonfoo+bar# not working```dolor sit amet.<!--pytest.mark.skipif(sys.version_info <= (3, 7), reason="Need at least Python 3.8")-->You can skip code blocks on import errors with<!--pytest-codeblocks:importorskip(sympy)-->Skip the entire file by putting<!--pytest-codeblocks:skipfile-->in the first line.For expected errors, usepytest.mark.xfail:The following gives an error:

<!--pytest.mark.xfail-->```python1/0```Merging code blocksBroken-up code blocks can be merged into one with thepytest-codeblocks:contprefixLorem ipsum```pythona=1```dolor sit amet

<!--pytest-codeblocks:cont-->```python# this would otherwise fail since `a` is not defineda+1```If you'd like to prepend code that you don't want to show, you can just comment it out;
pytest-codeblocks will pick it up anyway:Lorem ipsum

<!--```pythona=1```-->

dolor sit amet

<!--pytest-codeblocks:cont-->```python# this would otherwise fail since `a` is not defineda+1```Expected outputYou can also define the expected output of a code block:This```shprint(1+3)```gives

<!--pytest-codeblocks:expected-output-->```4```Useexpected-output-ignore-whitespaceif you'd like whitespace differences to
be ignored.(Conditionally) Skipping the output verfication works by prepending the first
block withskip/skipif(seeabove).
Package: pytest-codecarbon
pytest-codecarbonPytest plugin for measuring carbon emissions.InstallationThis plugin is installed via pip using:pip3 install pytest-codecarbonUsageTo use, simply run pytest with the--carbonoption. When the tests have run, you will find anemissions.csvfile containing each test, and the carbon, time and energy statistics for each test. You can also use--carbon-dirto specify a different directory for theemissions.csvfile.
Package: pytest-codecov
Pytest plugin for uploadingpytest-covresults tocodecov.ioThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesUploads coverage results tocodecov.ioat the end of the tests.Detects current project slug, branch and commit usingGitPython, when installed and running inside a git repository.Requirementspytest-covrequestsGitPython(Optional, for auto detecting some meta data)InstallationYou can install “pytest-codecov” viapipfromPyPI:$ pip install pytest-codecovUsageAdd--codecovto pytest arguments to enable uploadSupply your Codecov token either through--codecov-token=orCODECOV_TOKENenvironment variable. Refer to your CI’s documentation to properly secure that token.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-codecov” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-codegen
pytest-codegenPytest-codgen will statically analyze your code to create pytest function stubs.Built withredbaron,typerandjinja2.GoalFirst working versionFuture GoalsCreate templates for testsMore customizationDisclaimerThis tool is currently in pre-alpha/experimental phase. Usable version will be ^0.1.xInstallationpip install pytest-codegenUsageCheck the supported commands withpytest-codegen --helpor if you are lazy like meptc --helpSuggestions & ContributionEvery suggestion and contribution is welcome!Set everything up withpoetryand you are good to go :)pip install poetrypoetry installRessourcespytest-codegen on pypiredbaron on pypityper on pypijinja2 on pypiLicenseThis project is licensed under the terms of the MIT license.
Package: pytest-codeowners
pytest-codeownersPytest plugin for selecting tests by GitHub CODEOWNERS.QuickstartInstall with:pipinstallpytest-codeownersUsageLike so:pytest--codeowners-filedocs/CODEOWNERS\--codeowners-owner@org/team-name\--codeowners-ownermy@email.com\--codeowners-owner@MyUsernameBuildingTo build this library as a wheel:pythonsetup.pybdist_wheel--universalTestingFirst, make sure you install the package:pythonsetup.pyinstallTo run all tests, simply do:pytestLegalCopyright 2022IRESS Ltd.License: Apache License 2.0.
Package: pytest-codestyle
pytest-codestylepytestplugin to runpycodestyleInstallationpipinstallpytest-codestyleUsagepytest--pycodestyle...For detail, please seepytest -hafter installation.ConfigurationThe behavior can be configured in the same style of pycodestyle.(cf.Configuration — pytest documentationandConfiguration — pycodestyle documentation)For example,[pycodestyle]
max-line-length = 127

[tool:pytest]
addopts = --pycodestyleLicenceThe MIT LicenseCopyright (c) 2019 OMOTO TsukasaAcknowledgmentspytest-dev / pytest-pep8 — Bitbucket
Package: pytest-codspeed
pytest-codspeedPytest plugin to create CodSpeed benchmarksRequirementsPython: 3.7 and laterpytest: any recent versionInstallationpipinstallpytest-codspeedUsageCreating benchmarksCreating benchmarks withpytest-codspeedis compatible with the standardpytest-benchmarkAPI. So if you already have benchmarks written with it, you can start usingpytest-codspeedright away.Marking a whole test function as a benchmark withpytest.mark.benchmarkimportpytestfromstatisticsimportmedian@pytest.mark.benchmarkdeftest_median_performance():returnmedian([1,2,3,4,5])Benchmarking selected lines of a test function with thebenchmarkfixtureimportpytestfromstatisticsimportmeandeftest_mean_performance(benchmark):# Precompute some data useful for the benchmark but that should not be# included in the benchmark timedata=[1,2,3,4,5]# Benchmark the execution of the functionbenchmark(lambda:mean(data))deftest_mean_and_median_performance(benchmark):# Precompute some data useful for the benchmark but that should not be# included in the benchmark timedata=[1,2,3,4,5]# Benchmark the execution of the function:# The `@benchmark` decorator will automatically call the function and# measure its execution@benchmarkdefbench():mean(data)median(data)Running benchmarksTesting the benchmarks locallyIf you want to run only the benchmarks tests locally, you can use the--codspeedpytest flag:pytesttests/--codspeedNote:Runningpytest-codspeedlocally will not produce any performance reporting. It's only useful for making sure that your benchmarks are working as expected. If you want to get performance reporting, you should run the benchmarks in your CI.In your CIYou can use theCodSpeedHQ/actionto run the benchmarks in Github Actions and upload the results to CodSpeed.Example workflow:name:benchmarkson:push:branches:-"main"# or "master"pull_request:jobs:benchmarks:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v3-uses:actions/setup-python@v3with:python-version:"3.9"-name:Install dependenciesrun:pip install -r requirements.txt-name:Run benchmarksuses:CodSpeedHQ/action@v1with:token:${{ secrets.CODSPEED_TOKEN }}run:pytest tests/ --codspeed
Package: pytest-collect-interface-info-plugin
Get executed interface information in pytest interface automation frameworkThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-collect_info_plugin” viapipfromPyPI:$ pip install pytest-collect_info_pluginUsageTODOContributingContributions 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-collect_info_plugin” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-collect-pytest-interinfo
A simple plugin to use with pytestThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-collect-pytest-interinfo” viapipfromPyPI:$ pip install pytest-collect-pytest-interinfoUsageTODOContributingContributions 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-collect-pytest-interinfo” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-commander
PyTest CommanderA UI for controlling PyTest interactively. With it, you can explore your
test hierarchy (test packages/modules/classes/methods etc.), run tests at the
click of a button and see the results presented in your web browser.FeaturesRun tests by group (module, class etc.) or individually.Clear pass/fail labelling so you can dig down and find what failed quickly,
instead of having to scroll up through many screens of terminal output.Test files and dependencies are reloaded every time so you can run, tweak your
code, then run again in a fast iteration cycle.Runs on any modern OS and browser (tested on Win10, macOS and Ubuntu with
Chrome, Firefox and Safari). IE is not supported.Automatically start and stop docker services while running if specified in adocker-compose.ymlfile in the root test directory.Tests are run in separate processes and reloaded for each invocation, allowing
tests to be tweaked and re-run without restarting the main process.PrerequisitesRequires Python3.6+ and pip.QuickstartInstall and get started running your own PyTest tests:pip install pytest-commander
pytest_commander /path/to/your/testsI recommend installing into an activatedvirtual environment. You will
want to make sure that all additional dependencies required to run your tests
are installed into the same virtual environment.When you run with default options, the web app to browse and run tests should be
opened automatically in your default browser. To view full docs for the
command-line parameters, runpytest_commander --help.Build from sourceAlternatively you may build from source. In addition to the prerequisites above,
you must ensure you have installedpipenvandnpm.git clone https://github.com/ryanc414/pytest_commander.git
cd pytest_commander
python build.py
python test.pyYou may then install the local directory into an activated virual environment,
along with other dependencies installed to run your tests:pip install .
pytest_commander /path/to/your/testsPyTest ConfigurationConfiguration for PyTest such as extra command-line arguments may be specified
by adding a pytest.ini file in the same directory. Seehttps://docs.pytest.org/en/latest/reference/customize.html#pytest-inifor more
details.Note that there is a known issue when using pytest_commander along with the
xdist plugin, used to parallelise tests among multiple processes. You will
have to remove xdist config options from your pytest.ini in order to use
pytest-commander.RenamingPreviously this project was called "pytest_web_ui". I felt that this name gave
too much emphasis to the implementation detail of the UI being a web app,
when it could easily have been implemented in some other way (e.g. as an
electron app) and still serve the same purpose. I chose the name
"pytest_commander" to reflect the true purpose of this project: giving a
friendly and intuitive interface for developers to take command of their tests.Happy testing!
Package: pytest-common-subject
pytest-common-subjectpytest-common-subjectis a "framework" for organizing tests to reduce boilerplate while writing, improve skimmability when reading, and bolster parallelization when executing the suite.To utilize this framework, we first choose a single function that our group of tests will all call — in other words, an entry point, or acommon subject. This function will be automatically called before each of our tests, with args and kwargs that can be customized by overriding fixtures — enabling child test classes to make HTTP requests as a different user, or to use a different cache backend, or to change the value of a monkeypatched method.The return value of the chosen function will be passed as a fixture to each test. To reap the full benefits of the framework, create separate tests to verify different aspects of the return value. Was the response status code a 200? Did the response contain the expected data? Were the expected rows created in the database? By using separate tests for each of these aspects, we can pinpoint and correct multiple bugs at once, instead of getting sucked into a fix-test-fix cycle with its chorus of "oh, bother, not again!"
Package: pytest-concurrent
Concurrently execute pytest testing withmulti-thread,multi-processandgeventThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesTesting concurrently with pytest, using one of the three modesMultiprocess (–concmode=mproc)Multithread (–concmode=mthread)Asynchronous Network with gevent (–concmode=asyncnet)The ability to designate the amount of work to be used for testingThe ability to put your tests into separate groupsRequirementsPython2 version [2.7.*]Python3 version [3.4+]Make sure you have the latest version of pytest installed for your environmentInstallationYou can install “pytest-concurrent” viapipfromPyPI:$ pip install pytest-concurrentUsageUse this plugin by running pytest normally and use –concmode [mode name][mode name] should be one of the following (mproc, mthread, or asyncnet)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-concurrent” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-confluence-report
Pytest confluence reportPytest plugin to convert test results into confluence page report to proceed with tests analysis.It will combine unique fail assertion messages to failed testcases and convert those into confluence tables which is omitted in other plugins such aspytest-html.⚠️Note:the project is under construction.ToolsProductionpython 3.6, 3.7, 3.8, 3.9typerlogurupytestDevelopmenttravisblackmypypylintflake8pydocstyleinterrogatebatsUsageInstallationpipinstallpytest-confluence-report
✨🍰✨Quick startPlease make sure yoursettings.ymlfile is properly configured before execution.pytest--junit-xml=pytest.xml--confluence-uploadSource codegitclonegit@github.com:vyahello/pytest-confluence-report.git
pipinstall-e.Or using direct release:pipinstallgit+https://github.com/vyahello/pytest-confluence-report@0.0.2Local debuggitclonegit@github.com:vyahello/pytest-confluence-report.git
python-mreport--settings-pathsettings.yml--xml-pathpytest.xml⬆ back to topDevelopment notesConfigurationIn order to enable plugin automatically within yourpytest.iniconfiguration file, please set an appropriate flag:[pytest]addopts=--confluence-uploador a shorten version:[pytest]addopts=--cuTestingGenerally,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,mypy,pydocstyleandinterrogate) and unittests (pytest,bats) will be run automatically after every made change to the repository.To be able to run code analysis, please execute command below:./analyse-source-code.shRelease notesPlease checkchangelogfile to get more details about actual versions and it's release notes.MetaAuthor –Volodymyr Yahello. Please checkauthorsfile for more details.Distributed 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 do the following simple steps:Clone the repository.Configuregitfor the first time after cloning with yournameandemail.pip install -r requirements.txtto install all project dependencies.pip install -r requirements-dev.txtto install all development project dependencies.Create 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 Request.What's nextAll recent activities and ideas are described at projectissuespage.
If you have ideas you want to change/implement please do not hesitate and create an issue.⬆ back to top
Package: pytest-consul
pytest-consul=============pytest-consul is a pytest plugin meant for being able to do integration andunit testing against [Hashicorp's Consul](https://www.consul.io/).This plugin is heavily influenced by the design of[DisposableConsul](https://github.com/EverythingMe/disposable-consul).Install-------$ pip install pytest-consulUsage-----When pytest-consul is installed, the fixtures available will ensure that anactual local consul agent in bootstrap mode is running.   The fixture objectcontains a dictionary containing each of the exposed consul ports by name.The `consul` fixture is session scoped.  All tests using it will share catalogand kv state.def test_consul_thing(consul):http_port = consul['http']my_app.register_consul(('localhost', http_port))my_app.do_something_that_writes_to_consul_kv()resp = requests.get('http://localhost:{port}/v1/key/my-test-key'.format(port=http_port))actual_value = base64.b64decode(resp.json()[0]['Value'])assert actual_value == 'my-expected-value'The `consul_clean` fixture is function scoped.  If you want a clean consul statefor a given test, this fixture will provide it.Note----The consul agent takes a second or two to start up, even in bootstrap mode.This makes these fixtures better for integration style tests, rather than unittests.  Using the function scope `consul_clean` in particular is going to addthat additional latency to every single test which uses it.  The flip side ofthis is that using the session scope `consul` will not give you test isolation;if your tests leave values in the kv store or catalog, it may affect any teststhat run after them.Options-------pytest-consul adds the option `--consul-binary` to py.test, allowing you toutilize a specific consul binary.  By default, it will pick the first `consul`available in the PATH.
Package: pytest-container
Find the latest documentation ondcermak.github.io/pytest_container.pytest_containeris apytestplugin
to test container images via pytest fixtures andtestinfra. It takes care of all the boring
tasks, like spinning up containers, finding free ports and cleaning up after
tests, and allows you to focus on implementing the actual tests.The plugin automates the following tasks:pull, launch, and stop containersbuild containers using aDockerfilewait for containers to become healthy before executing testsbind exposed container ports to free ports on the hostmount volumes via temporary directoriesparallel test execution through pytest-xdistbuild dependent container images in the correct orderrun the same test on as many container images as necessarycreate, launch and destroy podman podspytest_containerprovides four fixtures that give you everything you need
for testing containers. Spinning up a container image can be as simple as
instantiating aContainerand parametrizing a test function with thecontainerfixture:TW=Container(url="registry.opensuse.org/opensuse/tumbleweed:latest")@pytest.mark.parametrize("container",[TW],indirect=["container"])deftest_etc_os_release_present(container:ContainerData):assertcontainer.connection.file("/etc/os-release").existsThe fixture automatically pulls and spins up the container, stops it and removes
it after the test is completed. Your test function receives an instance ofContainerDatawith theContainerData.connectionattribute. TheContainerData.connectionattribute is atestinfraconnection object. It can be
used to run basic tests inside the container itself. For example, you can check
whether files are present, packages are installed, etc.Use casesRun functional tests on operating system container imagesVerify your software on multiple operating systems
Package: pytest-contextfixture
pytest-contextfixture makes it possible to define pytest fixtures as context managers.A contextfixture works like a standard fixture, but it allows the
definition to be written as a generator. This simplifies the teardown
code and allows for other context managers to be used within a fixture.Installationpip install pytest-contextfixtureUsageConsider this example, using the standardpytest.fixture:import pytest

@pytest.fixture
def dependency(request)
    def teardown():
        # fixture teardown code goes here
    request.addfinalizer(teardown)

    return 1234

def test_foo(dependency):
    assert fn_under_test(dependency) == 'expected'Withpytest.contextfixture, this is equivalent:import pytest

@pytest.contextfixture
def dependency(request):
    # fixture setup code goes here
    yield 1234
    # fixture teardown code goes here

def test_foo(dependency):
    assert fn_under_test(dependency) == 'expected'While this is a slightly nicer syntax, when using other context managers
to get a dependency for a fixture, this becomes more useful:@pytest_contextfixture
def dependency(request):
    with setup_something():
        with setup_something_else() as d:
            yield d

def test_foo(dependency):
    assert fn_under_test(dependency) == 'expected'test_foo will then run in the context of setup_something and
setup_something_else.
Package: pytest-contexts
A plugin to run tests written with theContextsframework usingpytestUsagepip install pytest-contextsOnce you’ve installed it,pytestwill find and run tests written using the contextsGiven/When/shouldconventions.Issues and PRs welcome.LicenseDistributed under the terms of theUnlicenselicense, “pytest-contexts” is free and open source softwareThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.
Package: pytest-copie
Overviewpytest-copie is apytestplugin that comes with acopiefixture which is a wrapper on top thecopierAPI for generating projects. It helps you verify that your template is working as expected and takes care of cleaning up after running the tests. :ledger:It is an adaptation of thepytest-cookiesplugin forcopiertemplates.It’s here to help templates designers to check that everything works as expected on the generated files including (but not limited to):linting operationstesting operationspackaging operationsdocumentation operations…Installationpytest-copieis available onPyPIand can be installed withpip:pip install pytest-copieUsageThecopiefixture will allow you tocopya template and run tests against it. It will also clean up the generated project after the tests have been run.deftest_template(copie):res=copie.copy(extra_answers={"repo_name":"helloworld"})assertres.exit_code==0assertres.exceptionisNoneassertresult.project_dir.is_dir()Context and template location can be fully customized, see ourdocumentationfor more details.
Package: pytest-copier
pytest-copierA pytest plugin to help testing Copier templatesNote:this was a PoC and it will receive the full code and documentation very soon.Getting startedInstallpytest-copier:# pippipinstallpytest-copier# pipenvpipenvinstallpytest-copier# PDMpdmaddpytest-copierContributingRead thededicated contributing guidelines.