Title
pytest: helps you write better programs — pytest documentation
Go Home
Description
Address
Phone Number
+1 609-831-2326 (US) | Message me
Site Icon
pytest: helps you write better programs — pytest documentation
Page Views
0
Share
Update Time
2022-05-04 09:09:05

"I love pytest: helps you write better programs — pytest documentation"

www.pytest.org VS www.gqak.com

2022-05-04 09:09:05

Navigation index modules | pytest-7.1 » pytest: helps you write better programs Next Open TrainingsPyConDE, April 11th 2022 (3h), Berlin, GermanyPyConIT, June 3rd 2022 (4h), Florence, ItalyProfessional Testing with Python, via Python Academy, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, GermanyAlso see previous talks and blogposts.pytest: helps you write better programs¶The pytest framework makes it easy to write small, readable tests, and canscale to support complex functional testing for applications and libraries.pytest requires: Python 3.7+ or PyPy3.PyPI package name: pytestDocumentation as PDF: download latestA quick example¶# content of test_sample.pydef inc(x): return x + 1def test_answer(): assert inc(3) == 5To execute it:$ pytest=========================== test session starts ============================platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.yrootdir: /home/sweet/projectcollected 1 itemtest_sample.py F [100%]================================= FAILURES =================================_______________________________ test_answer ________________________________ def test_answer():> assert inc(3) == 5E assert 4 == 5E + where 4 = inc(3)test_sample.py:6: AssertionError========================= short test summary info ==========================FAILED test_sample.py::test_answer - assert 4 == 5============================ 1 failed in 0.12s =============================Due to pytest’s detailed assertion introspection, only plain assert statements are used.See Get started for a basic introduction to using pytest.Features¶Detailed info on failing assert statements (no need to remember self.assert* names)Auto-discovery of test modules and functionsModular fixtures for managing small or parametrized long-lived test resourcesCan run unittest (including trial) and nose test suites out of the boxPython 3.7+ or PyPy 3Rich plugin architecture, with over 800+ external plugins and thriving communityDocumentation¶Get started - install pytest and grasp its basics just twenty minutesHow-to guides - step-by-step guides, covering a vast range of use-cases and needsReference guides - includes the complete pytest API reference, lists of plugins and moreExplanation - background, discussion of key topics, answers to higher-level questionsBugs/Requests¶Please use the GitHub issue tracker to submit bugs or request features.Changelog¶Consult the Changelog page for fixes and enhancements of each version.Support pytest¶Open Collective is an online funding platform for open and transparent communities.It provides tools to raise money and share your finances in full transparency.It is the platform of choice for individuals and companies that want to make one-time ormonthly donations directly to the project.See more details in the pytest collective.pytest for enterprise¶Available as part of the Tidelift Subscription.The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support andmaintenance for the open source dependencies you use to build your applications.Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.Learn more.Security¶pytest has never been associated with a security vulnerability, but in any case, to report asecurity vulnerability please use the Tidelift security contact.Tidelift will coordinate the fix and disclosure.License¶Copyright Holger Krekel and others, 2004.Distributed under the terms of the MIT license, pytest is free and open source software. About pytest pytest is a mature full-featured Python testing tool that helps you write better programs.Contents Home Get started How-to guides Reference guides Explanation Complete table of contents Library of examplesAbout the project Changelog Contributing Backwards Compatibility Python 2.7 and 3.4 Support Sponsor pytest for Enterprise License Contact Channels pytest: helps you write better programsA quick exampleFeaturesDocumentationBugs/RequestsChangelogSupport pytestpytest for enterpriseSecurityLicenseIndexUseful Links pytest @ PyPI pytest @ GitHub Issue Tracker PDF Documentation © Copyright 2015, holger krekel and pytest-dev team. Created using Sphinx 3.5.4.