Saravanan666/pypi-org huggingface dataset:
Package: pytest-faulthandler
Plugin for pytest that automatically enables thefaulthandlermodule during tests.Inspired by thenose faulthandlerplugin.This plugin is now part of pytest core since pytest 5.0, so users should not install this plugin together with that pytest version.Version 2.0.0 of this package is a dummy package for pytest 5.0 compatibility.UsageThe plugin is always active by default, but you can disable it by passing--no-faulthandlertopy.test.Options:--faulthandler-timeout=TIMEOUT: Dump the traceback of all threads if a
test takes more than TIMEOUT seconds to finish.RequirementsPython 2.7+, Python 3.4+pytestfaulthandler (Python 2.7)InstallInstall usingpip:$pipinstallpytest-faulthandlerChange LogPlease consult theCHANGELOG.
Package: pytest-figleaf
py.test plugin for reporting test coverage using the ‘figleaf’ package.Usageafter installation (e.g. viapip installpytest-figleaf) you can type:py.test --figleaf [...]to enable figleaf coverage.  A default “.figleaf” data file
and “html” directory will be created.  You can use--fig-dataandfig-htmlto modify the paths.
Package: pytest-filecov
pytest-filecovOverviewThis is a pytest plugin to monitor file accesses while tests are running,
then output a report listing files along with whether or not they were
accessed:$ py.test --filecov tests
============================= test session starts ==============================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
filecov: tests
rootdir: /home/rohan/src/pytest-filecov
plugins: cov-2.12.1, filecov-0.1.0
collected 3 items

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

============================ pytest-filecov report =============================
Filename                 Covered?
--------                 --------
tests/__init__.py        0
tests/fakecmd.py         1
tests/test_plugin.py     1
tests/some-file          1
tests/other-file         0
============================== 3 passed in 0.13s ===============================UsagePrerequisites:Linuxinotifywait(try installinginotify-toolspackage)Install the plugin:pip install pytest-filecovWhen running your test suite, add--filecov <path>specifying the directory
tree(s) for which you'd like a report:py.test --filecov somedirWhy?This plugin targets the following scenario:You've got a large, complex test suite.You've got some tests relying on external data stored in files.After some refactors, you expect some of the test data files are now unused
and you'd like to clean them up, but you have no reliable way to determine
what is or is not used.Just aspytest-covcan help you seek and destroy dead Python code after
refactors,pytest-filecovcan do the same for dead/unused data files.Caveats and missing featuresThis plugin is rudimentary, with many missing features.The format of the reporter is not configurable.The list of files included in the report comes fromgit ls-filesand
this is not configurable..pyfiles may commonly be listed as uncovered for various reasons
(e.g..pycfiles were used; or files were imported before
monitoring began)Contributions to improve any of the above are welcome.LicenseThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Package: pytest-filedata
pytest filedataeasily load test data from filesIntroductionThis was created to save the tediousness of working with sets of data for
testing inside the test files.Installingpipinstallpytest-filedataUsingAdd this to yourconftest.pyfile:importpytest_filedatapytest_filedata.setup(os.path.dirname(__file__))defpytest_generate_tests(metafunc):forfixtureinmetafunc.fixturenames:iffixture.startswith('data_'):data=pytest_filedata.get_data(fixture)metafunc.parametrize(fixture,list(data.values()),ids=list(data.keys()))LicenseCopyright 2016 20C, LLCLicensed under the Apache License, Version 2.0 (the "License");
you may not use this softare 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-filemarker
pytest-filemarkerApytestplugin that runs marked tests when files change.UsageFiles should have aPYTEST_MARKSvariable containing a list of marked tests to run when the files change.PYTEST_MARKS = ['markone', 'marktwo']

class MyClass:
    ...When this file has changed, any tests with marksmarkoneormarktwowill be run.To invoke the plugin, run:pytest --filemarker-activeBy default, the plugin will usegitto look at the changes betweenHEADandHEAD~1to generate a list of files to inspect. To override this, use the--filemarker-filesparameter:pytest --filemarker-files=FILE1,FILE2Optionsfilemarker:
  --filemarker-active   Should the plugin be active? Automatically set to True
                        if other options are specified.
  --filemarker-files=FILE1,FILE2
                        Files to search. If not supplied will look at the latest
                        changes from git.
  --filemarker-variable=VARIABLE
                        Variable which contains a list of marks. Defaults to
                        PYTEST_MARKSfilemarker-variablecan also be set wherever you configure pytest (e.g.pytest.ini).
Package: pytest-filter-subpackage
This package contains a simple plugin for thepytestframework that provides a
shortcut to testing all code and documentation for a given sub-package.InstallationThepytest-filter-subpackageplugin can be installed usingpip:$ pip install pytest-filter-subpackageIt is also possible to install the latest development version from the source
repository:$ git clone https://github.com/astropy/pytest-filter-subpackage
$ cd pytest-filter-subpackage
$ pip install .In either case, the plugin will automatically be registered for use withpytest.UsageThis plugin provides a-Poption which takes a comma-separated list
of sub-package names (without the top-level package name):pytest -P wcs,io.fitswhich is equivalent to:pytest **/wcs **/io/fitsWhen used in conjunction withpytest-doctestplusthis will result in both
the narrative documentation and code being tested for a given sub-package.LicenseThis plugin is licensed under a 3-clause BSD style license - see theLICENSE.rstfile.
Package: pytest-finer-verdicts
pytest-finer-verdictsA pytest plugin to treat non-assertion failures as test errors.Getting the pluginThe plugin can be installed viapip installpytest-finer-verdicts.
Similarly, it can be uninstalled viapip uninstallpytest-finer-verdicts.UsageConsider the following snippet in a filetest.py(available astemp/test.pyin the repository).import pytest

def test_pass():
    assert 70 <= 75

def test_fail():
    assert 75 <= 70

def test_error():
    raise RuntimeError()

def test_pytest_fail():
    pytest.fail("Fail")

def test_pytest_raises():
    with pytest.raises(ValueError):
        raise IndexError()With pytest-finer-verdicts plugin,py.test test.py-vwill
produce the following output.collected 5 items

test.py::test_pass PASSED
test.py::test_fail FAILED
test.py::test_error ERROR
test.py::test_pytest_fail FAILED
test.py::test_pytest_raises ERROR

================================== ERRORS ===================================
_______________________ ERROR at setup of test_error ________________________

    def test_error():
>       raise RuntimeError()
E       RuntimeError

test.py:13: RuntimeError
___________________ ERROR at setup of test_pytest_raises ____________________

    def test_pytest_raises():
        with pytest.raises(ValueError):
>           raise IndexError()
E           IndexError

test.py:22: IndexError
================================= FAILURES ==================================
_________________________________ test_fail _________________________________

    def test_fail():
>       assert 75 <= 70
E       assert 75 <= 70

test.py:9: AssertionError
_____________________________ test_pytest_fail ______________________________

    def test_pytest_fail():
>       pytest.fail("Fail")
E       Failed: Fail

test.py:17: Failed
================ 2 failed, 1 passed, 2 error in 0.05 seconds ================Notice howtest_errorandtest_pytest_raisesare flagged astest errorsby the plugin.AttributionCopyright (c) 2016-2018, Venkatesh-Prasad RanganathLicensed under BSD 3-clause “New” or “Revised” License
(https://choosealicense.com/licenses/bsd-3-clause/)Authors:Venkatesh-Prasad Ranganath
Package: pytest-firefox
pytest-firefox is a plugin forpytestthat provides
support for runningFoxPuppetto controlFirefox Web Browserwithin
a test.RequirementsYou will need the following prerequisites in order to use pytest-firefox:Python 2.7, 3.6pytest 3.0 or newerInstallationTo install pytest-firefox:$pipinstallpytest-firefoxUsageTo use pytest-firefox with your tests simply specifyfirefoxas a fixture
to your test.deftest_something(firefox):firefox.open_window()This will open a new window.pytest-firefoxalso creates a default Selenium WebDriver object namedselenium.
Package: pytest-fixturecollection
A pytest plugin to collect tests based on fixtures being used in testsThispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesFilter tests collection/execution based on fixtures being used by testsOne or more number(comma separated) of fixtures are supported with option–uses-fixturesOne can combine fixture based collection with pytests default options/plugins for further smart collection.RequirementsPython >= 3.9Pytest >= 3.5InstallationYou can install “pytest-fixturecollection” viapipfromPyPI:$ pip install pytest-fixturecollectionUsageOnce plugin is installed, run pytest command with “–uses-fixtures” option as shown below:# pytest --uses-fixtures fixture1,fixture2 tests/Explanation: All the tests usingfixture1orfixture2inside tests directory would be collected and executed and rest tests would be uncollected (not executed). You can also choose to just–collect-onlyto view what tests are collected.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 theBSD-3license, “pytest-fixturecollection” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-fixture-maker
pytest-fixture-maker: Load fixture data from local YAML files.pytest-fixture-maker is a plugin for pytest, which load fixtures data from local YAML files.Example file with fixtures:# fixtures/test_fetch_by_key.yml

--- 

test_fetch_by_key:
  storage: 
    accounts:
      - { key: 1, name: "Visa Classic" }
      - { key: 2, name: "Visa Gold"}

test_success:
  - id: First test case
    account_key: 1
    expected: { key: 1, name: "Visa Classic" }
  - id: Second test case
    account_key: 2
    expected: { key: 2, name: "Visa Gold" }

test_missing:
  - id: Try fetch missing account
    account_key: 3
    expected_exc: AccountNotFoundExample conftest.py file:# conftest.py

from typing import Any

import pytest

from tests.accounts import Account, AccountRepo, Storage


@pytest.fixture(scope="function")
def account(request) -> Account:
    """Account entity."""
    return Account(**request.param)


@pytest.fixture(scope="function")
def storage(request) -> Storage:
    """Entity storage."""
    storage = Storage()

    if "accounts" in request.param:
        accounts = [Account(**account) for account in request.param["accounts"]]
        storage.accounts = AccountRepo(accounts=accounts)

    return storage


@pytest.fixture(scope="function")
def expected(request) -> Any:
    """Expected test case result."""
    return request.paramExample tests:from typing import Type

import pytest

from tests.accounts import Account, AccountNotFound, Storage


@pytest.fixture
def account_key(request) -> int:
    """Test account identifier."""
    return request.param


@pytest.fixture
def expected(request) -> Account:
    """Expected test case result."""
    return Account(**request.param)


@pytest.mark.integration
def test_success(storage: Storage, account_key: int, expected: Account) -> None:
    """Successful fetch account by key from storage."""
    result = storage.accounts.fetch_by_key(account_key)

    assert result == expected


@pytest.fixture
def expected_exc(request) -> Type[AccountNotFound]:
    """Expected exception when account not found in storage."""
    return AccountNotFound


@pytest.mark.integration
def test_missing(storage: Storage, account_key: int, expected_exc: Type[AccountNotFound]) -> None:
    """Try to fetch missing account by key from storage."""
    with pytest.raises(expected_exc):
        storage.accounts.fetch_by_key(account_key)InstallationTo install pytest-fixture-maker, do:(env) $ python3 -m pip install pytest-fixture-makerChangelog0.1.0 (2021-09-19)Initial release.
Package: pytest-fixture-marker
A pytest plugin to add markers based on fixtures used.WhyThis plugin allows you to selectively run tests that require a certain fixture. This comes in handy if you’re refactoring fixtures.InstallationYou can install “pytest-fixture-marker” viapipfromPyPI:$ pip install pytest-fixture-markerUsageOnce installed, the plugin will automatically mark each test. Marker names are generated from the
fixture names.$ # run all tests that use the tempdir fixture
$ pytest -m fixture_tempdirIf you’re not happy with the marker name convention of adding afixture_prefix, you can
configure it by setting fixture_marker_expression in pytest.ini (or tox.ini or setup.cfg), or by
passing the –fixture-marker-expression argument. If both are specified the argument takes priority.The fixture marker expression must be a format string that will be filled with one positional
argument: the fixture name.$ # use custom marker naming expression
$ pytest -m foobar_tempdir --fixture-marker-expression=foobar_{}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-fixture-marker” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-fixture-ref
pytest fixture refDocumentation:https://rtaycher.github.io/pytest-fixture-refSource Code:https://github.com/rtaycher/pytest-fixture-refPyPI:https://pypi.org/project/pytest-fixture-ref/Let developers reference pytest fixtures without name matching magic.Pass fixtures via default value or decorator args instead of magic strings.Let me admit this is a bit of a hack.
It might be important to note that this still uses pytests usual magic string matching under the covers
by grabbing the function name and re-writing the function.
That means you do have to make sure pytest imports it by installing it/specifying it in pytest_plugins/etc
as well as importing it for reference.
It also means this technically works with fake/dummy functions with the same name
(in case you can't easily import some fixtures)example:from pytest_fixture_ref import using_fixtures_from_defaults, using_fixtures_from_kwargs

@using_fixtures_from_defaults
def test_bar1(_=fix_w_yield1, __=fix_w_yield2, tmp=tmp_path):
    assert tmp.exists()


@using_fixtures_from_kwargs(_=fix_w_yield1, __=fix_w_yield2, tmp=tmp_path)
def test_bar2(_, __, tmp):
    assert tmp.exists()You can also use it to reference fixtures from other fixtures@pytest.fixture
def first_entry():
    return "a"


@pytest.fixture
@using_fixtures_from_defaults
def order(fe=first_entry):
    return [fe]Installationpipinstallpytest-fixture-refDevelopmentClone this repositoryRequirements:PoetryPython 3.7+Create a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellTestingpytestDocumentationThe documentation is automatically generated from the content of thedocs directoryand from the docstrings
of the public signatures of the source code. The documentation is updated and published as aGithub project pageautomatically as part each release.ReleasingTrigger theDraft release workflow(pressRun workflow). This will update the changelog & version and create a GitHub release which is inDraftstate.Find the draft release from theGitHub releasesand publish it. When
a release is published, it'll triggerreleaseworkflow which creates PyPI
release and deploys updated documentation.Pre-commitPre-commit hooks run all the auto-formatters (e.g.black,isort), linters (e.g.mypy,flake8), and other quality
checks to make sure the changeset is in good shape before a commit/push happens.You can install the hooks with (runs for each commit):pre-commitinstallOr if you want them to run only for each push:pre-commitinstall-tpre-pushOr if you want e.g. want to run all checks manually for all files:pre-commitrun--all-filesThis project was generated using thewolt-python-package-cookiecuttertemplate.
Package: pytest-fixture-remover
pytest fixture remove codemodA LibCST codemod to remove pytest fixtures applied via theusefixturesdecorator,
as well as its parametrizations.[!NOTE]
Only fixture usage will be removed, not its definition.UsageThis package requires Python >= 3.8.Install from PyPI.pipinstallpytest-fixture-removerRun against your tests, specifying a fixture to remove.python-mlibcst.toolcodemod-xpytest_fixture_remover.RemovePytestFixtureCommandmy_project_tests/--nameclean_dbAdd--no-formatoption to stop LibCST from running Black against modified code.Before/after examples can be found in thetests.test_commandmodule.Note on formattingThis codemod assumes that the target code is formatted with Black using
the magic trailing comma. Itmaychange the existing formatting in several ways:When removing a fixture name from theusefixturescall.When removing a value that parametrizes the fixture viaparametrize.In both cases the behavior is the same and obeys the following rules:If there's only one item left after modifying, remove the trailing comma.If there are multiple items left after modifying and the removed item was the last,
preserve the last item's comma (or its absence).
Package: pytest-fixture-rtttg
pytest-fixture-rtttgIn the face of ambiguity, refuse the temptation to guess.This plugin detects when you have two fixtures that share the same name, and
throws an error in that case, instead of silently choosing the later/inner-most
one.Installationpip install pytest-fixture-rtttgAfter this, the plugin should automatically do its job.CustomizationWhen the duplicate name is intentional, you can use thedupemark to stop
this from happening:@pytest.fixture@pytest.mark.dupedefsome_fixture():...Usually though, you're better of just choosing a different name.
Package: pytest-fixtures
pytest-fixturesCommon fixtures for pytestTo use, just install it and pytest will automatically detect and load all fixtures:pip install pytest-fixturesTo install automatically, add it to your test requirements intox.iniorsetup.py.No DependenciesThis package does not depend on any other packages and never will. It uses standard libraries or uses run-time
imports and therefore it is lightweight to add to any project. As for which external run-time dependency a fixture
needs, that is documented here and shouldn’t matter as you would only use the fixtures that your project already has
dependencies on.Standard FixturesFixtures based on standard Python librariestest_dataTo get path, read, and write test data intests/datafolder, use thetest_datafixture.First, setup the path to test data path intests/conftest.py:frompathlibimportPathfromfixturesimportTestDataTestData.BASE_PATH=Path(__file__).parent/'data'And then get path to data files intests/datausingtest_datafixture:deftest_integration(test_data):obj=MyClass(test_data.path('sample.csv'))To write out test data:deftest_integration(test_data):output=run_cli()test_data.write('test_integration.output',output)Then read the test data to assert:deftest_integration(test_data):output=run_cli()expected_output=test_data.read('test_integration.output')assertexpected_output==outputClick FixturesFixtures for Click <http://click.pocoo.org/>cli_runnerTo invoke, assert exit, with stdout/stderr outputs on error:.. code-block:: pythondef test_cli(cli_runner):result = cli_runner.invoke( … )                       # Prints out stdout/stderr from result with headings
result = cli_runner.invoke_and_assert_exit(0, … )     # Same as above and asserts exit code == 0Links & Contact InfoPyPI Package:https://pypi.python.org/pypi/pytest-fixturesGitHub Source:https://github.com/maxzheng/pytest-fixturesReport Issues/Bugs:https://github.com/maxzheng/pytest-fixtures/issuesFollow:https://twitter.com/MaxZhengXConnect:https://www.linkedin.com/in/maxzhengContact: maxzheng.os @t gmail.com
Package: pytest-fixture-typecheck
pytest-fixture-typecheckis apytestplugin that inserts runtime assertions that your fixture usages are properly typed.ProblemPytest fixtures are magic that mypy does not understand. This typechecks just fine:@pytest.fixture
def myint():
    return 42

def test_basic(myint: str):
    assert myint == 42This test passes but the type annotation is wrong.With this pytest plugin it will pass typechecking all the same, but your test
will fail at least.If your tests do not have type annotations, this plugin does nothing. Use mypy
to enforce that everything has type annotations.LicenseLicensed under public domain.