Saravanan666/pypi-org huggingface dataset:
Package: pytest-shortcuts
pytest-shortcutsExpand command-line shortcuts listed in pytest configurationThispytestplugin was generated withCookiecutteralong with @hackebrot'scookiecutter-pytest-plugintemplate.Getting StartedInstall using your favourite python package manager:$ pip install pytest-shortcutsAdd some shortcuts to your pytest configuration:[pytest]
shortcuts =
    --live: -m "live and not slow"
    --slow: -m "live and slow"
    --offline: --disable-socket -m "not live"Now when you run your tests with eg--live, it will be as if you provided-m "live and not slow".ContributingIf you would like to contribute, you may need to install the following development tools:# Useful for installing tools like tox and pre-commit in a separate environment
pip install --user pipx

# We run the test suite with tox
pipx install tox
pipx install flake8

# Install pre-commit hooks to prevent commits that do not pass static checks
pipx install pre-commit
pre-commit installAdditionally, you will want to install a number of different Python versions for tox to use.
I would recommend usingpyenvto do this.
After you have installed pyenv, runtoxto see which Python versions you are missing and enable them.
For example:brew install pyenv              # If you have homebrew
tox -l                          # Check which Python versions are currently required
pipx inject tox tox-pyenv       # Make pyenv versions available to tox
pyenv install 3.6.11            # If you need a Python 3.6
pyenv install 3.7.8             # If you need a Python 3.7
pyenv install 3.8.5             # If you need a Python 3.8
pyenv local 3.6.11 3.7.8 3.8.5  # Make these versions locally available
tox                             # Run the test suite via tox (same as "make test")A simple Makefile is included to run development commands, just typemaketo see
a list of available commands.LicenseDistributed under the terms of theBSD-3 license, "pytest-shortcuts" is free and open source software
Package: pytest-simplehttpserver
pytest-simplehttpserverSimple fixture to spin up a simple HTTP server to serve static files for testing.Can be used for testing web scrapers, etc.FeaturesThe fixture spins up a HTTP server that serves static files on port 8000.UsageWhen running your tests you need to point pytest-simplehttpserver to root
directory with the static files you want to serve:$pytest--simplehttpserver-directory/home/user/mock_website/In your code, just pass the fixture to your tests:importrequestsdefmytest(simplehttpserver):response=requests.get('http://localhost:8000/')assertresponse.status_code==200InstallationYou can install "pytest-simplehttpserver" via pip from PyPI:$pipinstallpytest-simplehttpserverContributingContributions are very welcome. Tests can be run with pytest, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of the MIT license, "pytest-simplehttpserver" is free and open source software
Package: pytest-simple-settings
pytest-simple-settingsUsageWith defaultsimple_settings.settings:fromsimple_settingsimportsettingsdeftest_foo(fake_settings):fake_settings.FOO=1fake_settings.set(BAR=2)assertsettings.FOO==1assertsettings.BAR==2With customLazySettingsinstanceimportpytestfromsimple_settingsimportLazySettingsinstance=LazySettings('settings')@pytest.fixture()defsettings_instance():returninstancedeftest_foo(fake_settings):fake_settings.FOO=1fake_settings.set(BAR=2)assertinstance.FOO==1assertinstance.BAR==2
Package: pytest-single-file-logging
Allow for multiple processes to log to a single fileThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesAllows all workers created by xdist to log to the same configurationRequirementsPytestgevent 1.1+xdistInstallationYou can install “pytest-single_file_logging” viapipfromPyPI:$ pip install pytest-single_file_loggingUsageA pytest fixtureloggeris provided by this plugin. Using the fixture is easy:def test_warning_log(logger):
logger.warning('this is your last warning!')The standard library logging library is used with the logging configuration
pulled from the–logconfigoption. The supported format for the configuration
file is json and dictconfig. Documentation of dictconfig is locatedhereContributingContributions 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 theApache Software License 2.0license, “pytest-single_file_logging” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-skip-markers
What is Skip MarkersThis pytest plugin was extracted frompytest-salt-factories. It’s a collection of
of useful skip markers created to simplify and reduce code required to skip tests in
some common scenarios, for example, platform specific tests.InstallInstalling Skip Markers is as simple as:python-mpipinstallpytest-skip-markersAnd, that’s honestly it.UsageOnce installed, you can now skip some tests with some simple pytest markers, for example.importpytest@pytest.mark.skip_unless_on_linuxdeftest_on_linux():assertTrueContributingThe pytest-skip-markers project team welcomes contributions from the community.
For more detailed information, refer toCONTRIBUTING.DocumentationThe full documentation can be seenhere.
Package: pytest-skipper
A plugin that executes only the tests with changes in execution pathThisPytestplugin was generated withCookiecutteralong with@hackebrot’sCookiecutter-pytest-plugintemplate.FeaturesTODORequirementsTODOInstallationYou can install “pytest-skipper” viapipfromPyPI:$ pip install pytest-skipperUsageCapture execution trace$ py.test –traceThis will run the full test suite and record coverage scopes (= name of executed functions)
for each test. The scopes are stored in sqlite databaseskipper.db. The git repo may not
have any uncommitted changes when execution trace is recorded.Execute only tests with changes in execution path$ py.test –skipperThis command compares your projects git repo state against traces in scope database and selects
the execution trace with least code changes. After this the program calculates all scopes with
changes and uses those to select only the tests that have changes in their execution path.Update execution trace while running few tests$ py.test –skipper –traceYou can use--traceand--skipperarguments at the same time to update the previous
execution trace to the latest version without re-running all the tests. Execution traces are
stored after each test case, so it is possible to terminate this command and continue it later.List tests with changes$ py.test –dry-run-skipperSame as--skipper, but instead of running the tests, only outputs them. Useful to see what
tests need to be updated after code change.Similar projectspytest-testmonsmotherContributingContributions 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-skipper” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-skippy
pytest skippyAutomatically skip tests that don’t need to run!Most tests that are run on a pull request don’t actually exercise the changes
that are made. By running all tests (even if those tests are not relevant), the
test suite takes longer to complete and more machines may be needed to
parallelize tests to cut down on test time.pytest-skippydetects which tests don’t need to run by generating a
complete import graph for your tests. If nothing in the import graph has
changed (according to GIT), the test is skipped! This approach saves time
(getting you test results faster) and money (using less machines for parallel
builds)!Installationpipinstallpytest-skippyUsageAdd the--skippyoption to your pytest command.To specify a target branch, use the--skippy-target-branchoption.Example:py.test --skippy --skippy-target-branch origin/masterdocs:https://pytest-skippy.readthedocs.iorepository:https://github.com/a-feld/pytest-skippy
Package: pytest-skip-slow
pytest-skip-slowA pytest plugin to skip@pytest.mark.slowtests by default.
Include the slow tests with--slow.Installation$ pip install pytest-skip-slowUsageExampletest_slow.py:importpytestdeftest_normal():pass@pytest.mark.slowdeftest_slow():passNormal pytest sessions skip slow tests:(venv)$pytest-vtest_slow.py=========================testsessionstarts==========================collected2itemstest_slow.py::test_normalPASSED[50%]test_slow.py::test_slowSKIPPED(need--slowoptiontorun)[100%]=====================1passed,1skippedin0.00s=====================Include the slow tests with--slow:(venv)$pytest-v--slowtest_slow.py=========================testsessionstarts==========================collected2itemstest_slow.py::test_normalPASSED[50%]test_slow.py::test_slowPASSED[100%]==========================2passedin0.00s===========================Run only the slow tests with-m slow --slow:(venv)$pytest-v-mslow--slowtest_slow.py=========================testsessionstarts==========================collected2items/1deselected/1selectedtest_slow.py::test_slowPASSED[100%]===================1passed,1deselectedin0.00s====================
Package: pytest-skipuntil
A simple pytest plugin to skip the tests with deadline in a simple wayFeaturesUse this marker to specify the deadline for the skip: a convenient decorator to prevent skipping tests and never going back to fix them. When the deadline is behind, the test will start failing again.Requirementspytestpython>=3.8InstallationYou can install “pytest-skipuntil” viapipfromPyPI:$ pip install pytest-skipuntilUsageUse it as a decorator for the test that you want to skip:@pytest.mark.skip_until(
    deadline=datetime(2023, 12, 11),
    msg='This test requires a fix, but I can't do it right now :('
)
def test_something():
    ...The test will be skipped until 11/12/2023, but it will start failing again after this date, so you’ll be
reminded to make a fix.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-skipuntil” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-slack
pytest-slackPytest to Slack reporting pluginFree software: MIT licenseDocumentation:https://pytest-slack.readthedocs.io.RequirementsRequestsInstallationYou can install “pytest-slack” viapip:$ pip install pytest-slackUsageSetupslack hookUse this plugin by running pytest normally and use the following options to customize report:>>> slack:
  --slack_channel=SLACK_CHANNEL
                        Set the channel name to report
  --slack_hook=SLACK_HOOK
                        Used for reporting to slack
  --slack_report_link=SLACK_REPORT_LINK
                        Set the report link
  --slack_username=SLACK_USERNAME
                        Set the reporter name
  --slack_timeout=SLACK_TIMEOUT [DEFAULT = 10s ]
                        Set the timeout for sending results in seconds
  --slack_success_emoji=SLACK_SUCCESS_EMOJI [default = :thumbsup:]
                        Set emoji for a successful run
  --slack_failed_emoji=SLACK_FAILED_EMOJI [default = :thumbsdown:]
                        Set emoji for a failed run
  --slack_success_icon=SLACK_SUCCESS_ICON [default = None]
                        Set icon (a url) for a successful run. Overrides SLACK_SUCCESS_EMOJI
  --slack_failed_icon=SLACK_FAILED_ICON [default = None]
                        Set icon (a url) for a failed run. Overrides SLACK_FAILED_EMOJIExample$ pytest tests –slack_hook=https://hooks.slack.com/services/… –slack_channel=test_report_channel –slack_username=”Regression testing results”All kind of problems:Passed test:$ pytest tests –slack_hook=https://hooks.slack.com/services/… –slack_channel=test_report_channel –slack_username=”Regression testing results”  –slack_report_link=http://any_addressPassed test with link:IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.Credits[ ~ Dependencies scanned by PyUp.io ~ ]History1.0.1 (2019-04-18)First release on PyPI.2.1.2 (2020-02-10)Stable release.CreditsDevelopment LeadLaser,arseny.antonov@gmail.comContributorsrepsejnworblithammermstevensAWegnerGitHub
Package: pytest-slowest-first
Sort tests by their last duration, slowest first.Thispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.FeaturesSort tests on consecutive runs by their last duration, slowest first.Works withpytest-xdistby pre-assigning tests to workers based on their
last duration.Requirementspytestpytest-xdist (optional)InstallationYou can install “pytest-slowest-first” viapipfromPyPI:$ pip install pytest-slowest-firstUsageFor best results, use this plugin withpytest-xdistto run tests in parallel.
When used together, make sure to pass--dist=loadgrouptopytestto
ensure that tests are distributed evenly across workers.Example command line:$ pytest --sf -n auto --dist=loadgroupContributingContributions 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-slowest-first” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-slow-first
pytest-slow-firstOverviewpytest-slow-firstis a pytest plugin that optimizes test suite execution by sorting tests based on their duration from the last run. This ensures that slower tests run first, leading to more efficient utilization of resources when used in conjunction withpytest-xdist.How It WorksWhen running your test suite with this plugin, it saves the duration of each test in a file. On subsequent runs, tests are sorted based on the time they took to execute in the last run. This sorting minimizes the overall test suite execution time.Running tests withpytest-xdistwith multiple workers, evenly distributing slower tests among workers becomes crucial. Without this plugin, the default order may lead to inefficient resource utilization.pytest-slow-firstaddresses this issue by ensuring that slower tests are evenly distributed, reducing the total execution time.ExampleConsider a test suite with six tests, each taking varying amounts of time to run:Running this suite with two workers using onlypytest-xdistmight result in uneven distribution:However, withpytest-slow-first, the same suite will be executed more efficiently and takes less time to finish, as shown below:UsageTo usepytest-slow-firstalongsidepytest-xdist, simply add the--slow-firstoption:pytesttests--slow-first-n3# using along side xdistThe plugin initializes by running your suite as usual the first time. On subsequent runs, it sorts tests based on the time taken in the previous run.Multiple runsThe plugin's results file is cumulative. If a test run already exists in the file, its duration will be updated.Custom File LocationBy default, the plugin saves test durations in a file named pytest-slow-first.json in the current directory. You can change the location by setting the SLOW_FIRST_PATH environment variable:exportSLOW_FIRST_PATH=/tmp/pytest-slow-first.jsonpytest--slow-firstInstallationYou can install "pytest-slow-first" viapip:$ pip install pytest-slow-firstContributingContributions 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-slow-first" is free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: pytest-slow-last
Run tests in order of execution time (faster tests first)UsageFrom terminal:$ pytest --slow-lastOr in pytest.ini:[pytest]
addopts = --slow-lastInstallationYou can install “pytest-slow-last” viapipfromPyPI:$ pip install pytest-slow-lastFeaturesAllows to run tests in order of the execution time of the last run (faster tests first, new tests even before).-ff option has preference: if a test fails, it will be run first.RequirementsPython >= 3.5pytest >= 3.5ContributingContributions 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-slow-last” is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.Thispytestplugin was generated withCookiecutteralong with@hackebrot’scookiecutter-pytest-plugintemplate.
Package: pytest-smartcov
Smart coverage measurement and reporting for py.test test suites.Test suites are usually structured parallel to (or integrated with) the
structure of the code they test. If you ask py.test to run a certain subset of
your tests, you shouldn’t have to also tell coverage which subset of your code
it should measure coverage on for that run. Withpytest-smartcov, you don’t
have to.Prerequisitespytest-smartcovrequires Python 2.7 or higher andcoverage3.6 or higher.UsageIfpytest-smartcovis installed and you provide asmartcov_paths_hooksetting in yourpytest.ini, coverage will automatically be measured on all
your test runs, unless you provide the--no-covflag.ConfigurationTo usepytest-smartcov, provide asmartcov_paths_hookini-config
setting which is the Python dotted import path to a function. This function
should accept as its single parameter the list of test paths specified on apy.testcommand line, and should return the list of paths on which code
coverage will be measured.ReportingIf 100% of the measured code was covered,pytest-smartcovwill output a
single line at the end of test run notifying you that you have 100% coverage.If you have less than 100% coverage on the measured code,pytest-smartcovwill output a terminal report including only those files which had less than
100% coverage.If there was less than 100% overall coverage,pytest-smartcovwill also
output an HTML report (to thehtmlcov/directory by default, though this
can be configured normally in.coveragerc).CHANGES0.1 (2014.10.28)Initial working version.
Package: pytest-smell
Make your Python tests smell good!Pytest-Smell is a Python library for detecting bad smells in unit tests written with the help of Pytest.InstallationUse the package managerpipto install foobar.pipinstallpytest-smellUsage# Basic usagepytest-smell# Verbose output with traceback to smell in codepytest-smell--verbose# Specifying tests directory (if there is one dedicated) for optimizationpytest-smell--tests_path=path_to_tests# Specifying output path for exporting results as a CSV filepytest-smell--out_path=path_to_desired_directory# Using it in a CI pipeline (returning 0 as exit code if no smells were found, 1 otherwise)pytest-smell--ciContributingThe library is still work in progress and serves as a research tool. Any collaboration or discussion is welcome.
Contact:alexandrubodeag@gmail.com
Package: pytest-smtp-test-server
pytest-smtp-test-serverpytest plugin for usingsmtp-test-serveras pytest mock fixtures.InstallationInstallation with "pip"pipinstallpytest-smtp-test-serverInstallation with "poetry"poetryadd--groupdevpytest-smtp-test-serverUsageAfter installation, one could easily use one of the provided fixtures in your pytest test case:deftest_mail_sending(smtp_mock):my_mail_sending_method(host=smtp_mock.host,port=smtp_mock.port)assertlen(smtp_mock.messages)==1ScopesFixtures are provided for differentpytest fixture scopesfor your convenience:fixture namepytest fixture scopesmtp_mockfunctionclass_smtp_mockclassmodule_smtp_mockmodulepackage_smtp_mockpackagesession_smtp_mocksessionIf you require more control over hosts and ports, consider usingsmtp-test-serverdirectly.
Package: pytest-snail
pytest-snailPlugin for adding a marker to slow running tests. 🐌InstallationYou can installpytest-snailviapipfromPyPI:pip install pytest-snail==0.1.0UsageWhen you run your tests,pytest-snailkeeps track of test durations for
each test item by test phase: setup, call, and teardown. ⏱The next time you run your tests,pytest-snailadds asnailmarker to
all test items with a recorded, accumulated duration that is equal or longer
than the value for the--snailCLI option (defaults to5.0seconds).You can then use pytest's marker expressions to select or deselect tests.ExamplesFirst run your tests to measure test durations:pytestThen deselect all tests that take longer than5.0seconds to complete:pytest -m "not snail"Select only tests that take longer than10.0seconds to complete:pytest --snail 10.0 -m snailCommunityPlease check out thegood first issuelabel for tasks,
that are good candidates for your first contribution topytest-snail. Your contributions are greatly
appreciated! Every little bit helps, and credit will always be given!You can also support the development of this project by volunteering to
become a maintainer, which means you will be able to triage issues, merge
pull-requests, and publish new releases. If you're interested, please submit
a pull-request to add yourself to the list ofmaintainersand
we'll get you started! 🚀Please note thatpytest-snailis released with aContributor Code of
Conduct. By participating in this project you agree to
abide by its terms.LicenseDistributed under the terms of the MIT license,pytest-snailis free and
open source software.