Saravanan666/pypi-org huggingface dataset:
Package: pytest-flake8
UsageInstall by running the command:pip install pytest-flake8After installing it, when you run tests with the option:pytest --flake8every file ending in.pywill be discovered and checked with
flake8.NoteIf optional flake8 plugins are installed, those will
be used automatically. No provisions have been made for
configuring these viapytest.WarningRunning flake8 tests on your project is likely to cause a number
of issues. The plugin allows one to configure on a per-project and
per-file basis which errors or warnings to ignore, seeflake8-ignore.Configuring FLAKE8 options per project and fileMaximum line length and maximum doc line length can be configured for the
whole project by adding aflake8-max-line-lengthoption andflake8-max-doc-lengthto yoursetup.cfgortox.inifile like
this:# content of setup.cfg
[tool:pytest]
flake8-max-line-length = 99
flake8-max-doc-length = 74Note that the default will be what naturally comes withflake8(which it turn gets its default frompycodestyle).You may configure flake8-checking options for your project
by adding anflake8-ignoreentry to yoursetup.cfgortox.inifile like this:# content of setup.cfg
[tool:pytest]
flake8-ignore = E201 E231This would globally prevent complaints about two whitespace issues.
Rerunning with the above example will now look better:$ pytest -q  --flake8
collecting ... collected 1 items
.
1 passed in 0.01 secondsIf you have some files where you want to specifically ignore
some errors or warnings you can start a flake8-ignore line with
a glob-pattern and a space-separated list of codes:# content of setup.cfg
[tool:pytest]
flake8-ignore =
    *.py E201
    doc/conf.py ALLSo if you have a conf.py like this:# content of doc/conf.py

func (  [1,2,3]) #this line lots PEP8 errors :)then running again with the previous example will show a single
failure and it will ignore doc/conf.py altogether:$ pytest --flake8 -v # verbose shows what is ignored
======================================= test session starts ========================================
platform darwin -- Python 2.7.6 -- py-1.4.26 -- pytest-2.7.0 -- /Users/tholo/Source/pytest/bin/python
cachedir: /Users/tholo/Source/pytest/src/verify/.cache
rootdir: /Users/tholo/Source/angular/src/verify, inifile: setup.cfg
plugins: flake8, cache
collected 1 items

myfile.py PASSED

========================================= 1 passed in 0.00 seconds =========================================Note that doc/conf.py was not considered or imported.FAQsAll the flake8 tests are skipping!This is by design.  Clean flake8 results are cached and, unless the file is modified, not tested again.You can run withpytest--cache-clear--flake8to override this.NotesThe repository of this plugin is athttps://github.com/tholo/pytest-flake8For more info onpytestseehttp://pytest.orgThe code is partially based on Ronny Pfannschmidt’spytest-codecheckersplugin.
Package: pytest-flakefinder
Runs tests multiple times to expose flakiness.ThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesWhen enabled it will ‘multiply’ your tests so that they get run multiple times without having to restart pytest.  This helps you find flakiness in your tests.You can limit your flake runs to a particular timeout value.Installationpip install pytest-flakefinderFor best flake-finding combine with pytest-xdist:pip install pytest-xdistUsageFlake FindingEnable plugin for tests:pytest --flake-finderThis will run every test the default, 50, times.  Every test is run independently and you can even use xdist to send tests to multiple processes.To configure the number of runs:pytest --flake-finder --flake-runs=runsTo find flakes in one test or a couple of tests you can use pytest’s built in test selection.Finding flakes in one test:pytest -k test_maybe_flaky --flake-finderWhen used with xdist the flake finder can expose many timing related flakes.Timing OutWhen using flake-finder as part of a CI run it might be useful to limit the amount of time it will run.Running with timeout:pytest --flake-finder --flake-max-minutes=minutesTests started after the timeout will be skipped.ContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.Contributorseurestinipunn1313goodsparkand-semakinadaamzIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-flaptastic
pytest-flaptasticPy.test plugin for Flaptastic.https://www.flaptastic.com/InstallationTo install pytest-flaptastic:$ pip install pytest-flaptasticEnvironment variables:RequiredEnvironment Variable NameDescriptionYesFLAPTASTIC_ORGANIZATION_IDOrganization idYesFLAPTASTIC_API_TOKENAPI tokenYesFLAPTASTIC_SERVICEName of service (aka microservice) under testNoFLAPTASTIC_BRANCHBranch name being tested. In git, you might pass "master" or names like "myFeature"NoFLAPTASTIC_COMMIT_IDVersion id of code tested. In git, this would be the commit shaNoFLAPTASTIC_LINKLink to CI (Jenkins/Circle/Travis etc) website page where you can find the full details of the test run, if applicableNoFLAPTASTIC_VERBOSITYStdout verbosity. 0=none 1=minimal 2=everythingExample call pattern:$ FLAPTASTIC_ORGANIZATION_ID=123 \
  FLAPTASTIC_API_TOKEN=foo \
  FLAPTASTIC_SERVICE=monolith \
  FLAPTASTIC_BRANCH=master \
  FLAPTASTIC_COMMIT_ID=2feffa9bf0bf3fc48f9f9e89c5386afe0cb77124 \
  FLAPTASTIC_LINK=http://jenkins.example.com \
  py.testCircleCI 2.0 ConfigurationA simple project might have a CircleCI 2.0 YML that ultimately does a 'make test' like this:- run: make testIn CircleCI 2.0, we must map some of Circle's variables to Flaptastic varibles and include the Flaptastic organization id like this:- run:
          name: Run PyTest With Flaptastic
          environment:
            FLAPTASTIC_ORGANIZATION_ID: "<your org id goes here>"
            FLAPTASTIC_VERBOSITY: 1
          command: |
            echo 'export FLAPTASTIC_BRANCH=$CIRCLE_BRANCH' >> $BASH_ENV
            echo 'export FLAPTASTIC_LINK=$CIRCLE_BUILD_URL' >> $BASH_ENV
            echo 'export FLAPTASTIC_SERVICE=$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
            echo 'export FLAPTASTIC_COMMIT_ID=$CIRCLE_SHA1' >> $BASH_ENV
            source $BASH_ENV
            make testPlease be sure to pass your selected organization ID as the actual ID value from your Flaptastic account as a string with double quotes. At the time of this writing, CircleCI will botch our 64-bit integer ids without the double quotes.Finally, find your Flaptastic API token and then go to your CircleCI project page. Navigate to the project environment variables screen and create an enviornment variable called "FLAPTASTIC_API_TOKEN" and then paste your token as the value.Licensepytest-flaptastic is available under the MIT License.
Package: pytest-flask-ligand
Pytest fixtures and helper functions to use for testing flask-ligand microservices.Developer Quick Start GuideFollow the instructions below to get a development environment up and running quickly!PrerequisitesPython 3.10+virtualenvwrapperGetting Help with Make TasksExecute the following command to get a full list ofmaketargets:$ make helpSetup Python Development EnvironmentCreate a Python virtual environment:$ mkvirtualenv -p py310 pytest-flask-ligandSetup develop environment:$ make develop-venvSetup git pre-commit hooks:$ make setup-pre-commitVerify that environment is ready for development:$ make test-allContributingSeeCONTRIBUTING.rstfor more details on developing for thepytest-flask-ligandproject.Release ProcessSeerelease_process.rstfor information on the release process for thepytest-flask-ligandproject.Python Black IDE IntegrationThis repo utilizesPython Blackfor automatic code formatting using themake formattask. However, this is not
very convenient to use on a regular basis and instead it is recommended to integrate Python Black into your IDE
workflow. Checkout theseeditor integrationguides for integratingPython Blackwith popular IDEs and text
editors.
Package: pytest-flexreport
pytest-flexreport1、介绍pytest-flexreport是针对pytest的生成html报告的插件，自动收集用例执行的详细日志信息，以及相关错误和输出信息。
使用起来非常简单，安装好pytest-testreport之后，运行用例时加上参数即可生成报告2、安装pytest-testreport是基于python3.7+开发的，安装前请确认你的python版本>3.7安装命令pip install pytest-flexreport3、快速开始注意：如果安装了pytest-html这个插件，可能会有冲突，如果冲突则先卸载pytest-html3.1 template介绍--template=1：白底报告，以用例为维度，含详情--template=2：蓝底报告，以用例为维度，含详情--template=3：蓝底报告，结果概述，统计模块通过率（使用场景：邮件发送summary）3.2 使用案例命令行执行： pytest 运行测试时加上参数--report 指定报告文件名# 指定报告文件名pytest--report=demo-report.html#其他配置参数--template=3,测试报告模板选择(1,2,3)--report=/*/*.html,报告生成绝对路径
--history_dir=history.json的目录路径,默认使用html文件同级目录
--title=测试报告标题,回填到报告
--tester=测试人员,回填到报告
--desc=测试构建描述,回填到报告
--log_path=测试日志路径,回填到报告(template=3)--report_path=测试报告详情路径,回填到报告(template=3)--testcase_basename=测试用例root-dirbasename,供遍历__init__.py查找模块名(template=3)# 同时使用多个参数pytest--report=report.html--history_dir=./reports--title=测试报告--tester=txu--desc=项目描述pytest.main执行importpytest

pytest.main(['--report=demo-report.html','--history_dir=./reports','--title=测试报告标题','--tester=txu','--desc=报告描述信息'])
Package: pytest-forcefail
# pytest-forcefailpytest-forcefail is a plugin providingthe methodpytest_forcefail.forcefailthe exception classpytest_forcefail.ForceFailedThese two will make the test failingregardless of pytest.mark.xfail.See test_forcefail.py for example.Binary distribution:https://pypi.org/project/pytest-forcefail/
Package: pytest-forked
Warningthis is a extraction of the xdist –forked module,
future maintenance beyond the bare minimum is not planned until a new maintainer is found.This plugindoes not work on Windowsbecause there’s noforksupport.--forked: run each test in a forked
subprocess to surviveSEGFAULTSor otherwise dying processes.InstallationInstall the plugin with:pip install pytest-forkedor use the package in develope/in-place mode with
a checkout of thepytest-forked repositorypip install -e .Usage examplesIf you have tests involving C or C++ libraries you might have to deal
with tests crashing the process.  For this case you may use the boxing
options:pytest --forkedwhich will run each test in a subprocess and will report if a test
crashed the process.  You can also combine this option with
running multiple processes via pytest-xdist to speed up the test run
and use your CPU cores:pytest -n3 --forkedthis would run 3 testing subprocesses in parallel which each
create new forked subprocesses for each test.You can also fork for individual tests:@pytest.mark.forked
def test_with_leaky_state():
    run_some_monkey_patches()This test will be unconditionally boxed, regardless of CLI flag.
Package: pytest-frappe
pytest-frappepytest-frappeis a set of pytest fixtures for testing Frappe applications. It provides two fixtures:db_instanceanddb_transaction, which can be used to create and manage database connections.InstallationYou can installpytest-frappevia pip:pipinstallpytest-frappeUsageTo use the fixtures provided bypytest-frappedeftest_foo(db_transaction):# use the db_instance fixture to interact with the databasepasspytest-frappealso provides a command line option,--sites-path, which can be used to specify the directory where your Frappe sites are stored. This option is required to initialize thedb_instancefixture.Here's an example of how you can use the--sites-pathoption:pytest--sites-path=/path/to/sites/directoryAvailable fixturesdb_instanceThedb_instancefixture provides a database connection to a Frappe application. It is created at the beginning of the test session and destroyed at the end of the session. This fixture is used to perform database operations.db_transactionThedb_transactionfixture is a database transaction context manager. It creates a new transaction at the beginning of each test function and rolls back the transaction at the end of the test function. This fixture is used to perform database operations within a transaction.Licensepytest-frappeis licensed under the MIT License. See LICENSE for more information.
Package: pytest-freezegun
Wrap tests with fixtures in freeze_timeFeaturesFreeze time in both the test and fixturesAccess the freezer when you need itInstallationYou can install “pytest-freezegun” viapipfromPyPI:$ pip install pytest-freezegunUsageFreeze time by using thefreezerfixture:def test_frozen_date(freezer):
    now = datetime.now()
    time.sleep(1)
    later = datetime.now()
    assert now == laterThis can then be used to move time:def test_moving_date(freezer):
    now = datetime.now()
    freezer.move_to('2017-05-20')
    later = datetime.now()
    assert now != laterYou can also pass arguments to freezegun by using thefreeze_timemark:@pytest.mark.freeze_time('2017-05-21')
def test_current_date():
    assert date.today() == date(2017, 5, 21)Thefreezerfixture andfreeze_timemark can be used together,
and they work with other fixtures:@pytest.fixture
def current_date():
    return date.today()

@pytest.mark.freeze_time
def test_changing_date(current_date, freezer):
    freezer.move_to('2017-05-20')
    assert current_date == date(2017, 5, 20)
    freezer.move_to('2017-05-21')
    assert current_date == date(2017, 5, 21)They can also be used in class-based tests:class TestDate:

    @pytest.mark.freeze_time
    def test_changing_date(self, current_date, freezer):
        freezer.move_to('2017-05-20')
        assert current_date == date(2017, 5, 20)
        freezer.move_to('2017-05-21')
        assert current_date == date(2017, 5, 21)ContributingContributions are very welcome.
Tests can be run withtox.
You can later check coverage withcoverage combine && coverage html.
Please try to keep coverage at least the same before you submit a pull request.LicenseDistributed under the terms of theMITlicense, “pytest-freezegun” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.CreditsThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.
Package: pytest-freezer
pytest-freezerPytestplugin providing a fixture interface forfreezegun.Installation:$python-mpipinstallpytest-freezerUsage:The fixture name isfreezer. It is afreezegun.api.FrozenDateTimeFactoryinstance, so refer to upstream freezegunusagefor the methods.Time is frozen by default when the fixture is injected:deftest_frozen_date(freezer):now=datetime.now()time.sleep(1)later=datetime.now()assertnow==laterTime can be controlled within a test by using methods on the fixture:deftest_freezer_methods(freezer):freezer.move_to("2022-10-17")assertdatetime.now()==datetime(2022,10,17)freezer.tick()assertdatetime.now()==datetime(2022,10,17,0,0,1)freezer.tick(delta=12)assertdatetime.now()==datetime(2022,10,17,0,0,13)Acknowledgements:Credit to Tomasz Kontusz for the originalpytest-freezegunplugin.
Package: pytest-freeze-reqs
pytest freeze reqsPytest plugin that tests if requirements are frozen.**/req*.txt and **/req*.pip are the patterns of path to match.ok and not ok lines in requirements.txtDjango<2.2  # ok
Django>=1.0  # not ok
requests  # not ok
requests>1.0,<2.3  # ok
-e git://github.com/org/pkg.git#egg=pkg  # not ok
-e git://github.com/org/pkg.git@{revision}#egg=pkg  # ok
-e /local/file  # okexample error================================== FAILURES ===================================
_________________ requirement: Django is not frozen properly. _________________
requirement freeze test failed
   improperly frozen requirement: 'Django': [('>', '1.0')]
   try adding pkg==version, or git@revision
________________ requirement: requests is not frozen properly. ________________
requirement freeze test failed
   improperly frozen requirement: 'requests': []
   try adding pkg==version, or git@revision
________________ requirement: pkg is not frozen properly. _____________________
requirement freeze test failed
   improperly frozen requirement: 'pkg': '[no revision]'
   try adding pkg==version, or git@revisionusage# just add --freeze_reqs arg to pytestpytest--freeze_reqs# if you want to run only freeze_reqs testspytest-mfreeze_reqs--freeze_reqspytest.ini configuration# here you can configure paths/files to ignore
# these are checked with contain.
freeze-reqs-ignore-paths=requirement_local.txt
                         requirements/req_dev.txt

# here you can configure paths/files to include
# these are checked with contain.
freeze-reqs-include-paths=requirements/base.txt
                          requirements/development.txt
Package: pytest-frozen-uuids
pytest-frozen-uuidsDeterministically frozen UUID's for your tests.FeaturesFreeze UUID's globally and locally.InstallationYou can install "pytest-frozen-uuids" viapipfromPyPI:$ pip install pytest-frozen-uuidsUsageFreeze UUID's by using thefreeze_uuidsfixture:def test_freeze_uuids(freeze_uuids):
    import uuid
    assert str(uuid.uuid4()) == "00000000-0000-0000-0000-000000000000"Or by using thefreeze_uuidsmarker:import pytest

@pytest.mark.freeze_uuids
def test_freeze_uuids():
    import uuid
    assert str(uuid.uuid4()) == "00000000-0000-0000-0000-000000000000"ContributingContributions are very welcome. Tests can be run withtox.
You can later check coverage with coverage combine && coverage html. Please try to keep coverage at
least the same before you submit a pull request.LicenseDistributed under the terms of theMITlicense,
"pytest-frozen-uuids" is free and open source softwareIssuesIf you encounter any problems, pleasefile an
issuealong with a detailed
description.CreditsThisPytestplugin was generated withCookiecutteralong with@hackebrot'sCookiecutter-pytest-plugintemplate.
Package: pytest-func-cov
BuildReleaseOverviewThis plugin attempts to provide a more meaningful test coverage metric for projects using pytest. The assumption is that,
in reality, the proportion of lines of code covered by tests does not entirely reflect how
much the tests explicitly cover. An additional indicator is how many functions, out of the total functions
defined in a project, are explicitly invoked during tests. This way, a test which
only calls a higher order function will not also count as testing the functions that it invokes during its execution, unlike traditional test coverage metrics.pytest_func_cov provides an implementation of this metric, covering functions as well as
methods, classmethods and staticmethods. A function is considered tested if it is invoked explicitly
from a test function at least once. To make this check, the second stack frame is inspected
when a discovered function is invoked.Usagepytest--func_cov=myprojecttests/Produces a report like:--------------------pytest_func_cov-----------
Name                   Funcs   Miss     Cover
----------------------------------------------
myproject/module1.py       7      5       28% 
myproject/module2.py      10      3       70%
----------------------------------------------
TOTAL                     17      8       47%Similar to pytest-cov, you can use the--func_cov_reportargument to configure the output. At the moment, the only
supported option isterm-missing, which adds another column to the output which lists all untested functions.pytest--func_cov=myproject--func_cov_report=term-missingtests/Produces a report like:--------------------pytest_func_cov--------------------
Name                   Funcs   Miss     Cover   Missing
-------------------------------------------------------
myproject/module1.py       7      5       28%   func1, func2, MyClass.method, MyClass.static_method, MyClass.class_method
myproject/module2.py      10      3       70%   func3, func4, <lambda>
-------------------------------------------------------
TOTAL                     17      8       47%ConfigurationA list of function name patterns to ignore can be specified in pytest.ini.Example:[pytest]ignore_func_names=^test_*^myfunction$This will ignore all function names starting with "test_" and functions named "myfunction".
Package: pytest-fxa
pytest-fxa is a plugin forpytestthat provides test accounts forFirefox Accounts.RequirementsYou will need the following prerequisites in order to use pytest-fxa:Python 2.7, 3.6, PyPy, or PyPy3InstallationTo install pytest-fxa:$pipinstallpytest-fxaCreating a test Firefox AccountTo create a Firefox Account for testing, include thefxa_accountfixture
name in your test method signature. This is a tuple with named properties for
the test account’semailandpassword. The following example shows how
this could be used withSeleniumto sign into a website that uses Firefox
Accounts for authentication:deftest_my_fxa_site(fxa_account,selenium):selenium.get('https://example.com/')selenium.find_element(By.ID,'email').send_keys(fxa_account.email)selenium.find_element(By.ID,'password').send_keys(fxa_account.password)selenium.find_element(By.ID,'login').click()The test account will be automatically destroyed when it’s no longer needed.Specifying an environmentBy default all accounts will be created on the ‘stage’ environment. You can set
theFXA_ENVenvironment variable to target ‘production’ or ‘stable’.If you need to override the environment for a subset of tests, or run tests against multiple environments, you can use thefxa_envmarker:@pytest.mark.fxa_env('production')deftest_production(fxa_account):selenium.get('https://example.com/')selenium.find_element(By.ID,'email').send_keys(fxa_account.email)selenium.find_element(By.ID,'password').send_keys(fxa_account.password)selenium.find_element(By.ID,'login').click()@pytest.mark.fxa_env('stage','stable')deftest_stage(fxa_account):selenium.get('https://elpmaxe.com/')selenium.find_element(By.ID,'email').send_keys(fxa_account.email)selenium.find_element(By.ID,'password').send_keys(fxa_account.password)selenium.find_element(By.ID,'login').click()Alternatively, you can override thefxa_urlsfixture for full control of
the URLs for your environment:@pytest.fixturedeffxa_urls():return{'authentication':'https://api-accounts.stage.mozaws.net/v1','oauth':'https://oauth.stage.mozaws.net/v1','content':'https://accounts.stage.mozaws.net/','profile':'https://profile.stage.mozaws.net/v1','token':'https://token.stage.mozaws.net/'}ResourcesRelease NotesIssue TrackerCode
Package: pytest-fzf
pytest-fzffzf-based test selection withpytest(demo uses thegruvbox-dark pygments style)FeaturesSelect tests to be run with pytest using fzfRequirementsfzfInstallationYou can installpytest-fzfviapipfromPyPI:pipinstallpytest-fzfUsagepytest--fzf[query]pytest--fzf[--fzf-bat-preview]# uses bat as fzf preview commandSyntax highlighting themeThe theme used for previewing test functions can be set usingPYTEST_FZF_THEME(orBAT_THEME, if you usebat, seesharkdp/bat):exportPYTEST_FZF_THEME='gruvbox-dark'For a list of supported themes, seehttps://pygments.org/styles/or get a list by running:importpygmentsforstyleinpygments.styles.get_all_styles():print(style)KeybindingsThe following keybindings can be used in the fzf selection menuTab: selected/deselect testsShift+Tab: selected/deselect tests (move up)Ctrl+a: select/deselect all testsContributingContributions are very welcome. Tests can be run withnox, please ensure the coverage at
least stays the same before you submit a pull request.LicenseDistributed under the terms of theGNU GPL
v3.0license,pytest-fzfis free and open source softwareIssuesIf you encounter any problems, pleasefile an
issuealong with a
detailed description.
Package: pytest-gather-fixtures
Pytest-Gather-Fixtures:  run async fixtures concurrentlypytest-gather-fixtures is a library for pytest that allows you to set up and tear down fixtures in
parallel. It's useful for when you have multiple independent fixtures that take a long time to set
up.importasynciofrompytest_gather_fixturesimportConcurrentFixtureGroupmy_fixture_group=ConcurrentFixtureGroup('my_fixture_group')@my_fixture_group.fixtureasyncdefmy_fixture_1():awaitasyncio.sleep(1)@my_fixture_group.fixtureasyncdefmy_fixture_2():awaitasyncio.sleep(1)deftest_foo(my_fixture_1,my_fixture_2):# setup for this test will only take 1 secondpass