Python Testing with Pytest Simple, Rapid, Effective, and Scalable

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Okken, Brian
Format: E-Book
Sprache:Englisch
Veröffentlicht: La Vergne Pragmatic Programmers, LLC, The 2022
Ausgabe:2
ISBN:9781680508604, 1680508601
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Author Okken, Brian
Author_xml – sequence: 1
  fullname: Okken, Brian
BookMark eNqFjU1LAzEYhCN-oK37BzztTS8LyZvkzZujLvUDCnooXkvSJHaxJNpdEf-9gXr3NDwzw8yMneSS4xGbCSSuuVWSjlljDR2YkKuzGmqujZSA9pw14zh4rhFRSYMX7OrlZ9qW3K7iOA35rf0epm1bvYqX7DS53RibP52z1_vFqn_sls8PT_3tsnMghKIuEESioABdcmS5x0gmqeBd1N6IuDEgXXBEBDoEMBCQJ-NDChpEQifn7Pow_LEvn1_1eR19Ke-bmKe9260Xdz1apdFibd7805TCglXA5S_upU4x
ContentType eBook
DEWEY 005.133
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 1680509438
9781680509434
9781680509441
1680509446
Edition 2
ExternalDocumentID EBC6945696
EBC31929420
GroupedDBID ALMA_UNASSIGNED_HOLDINGS
AABBV
BBABE
ID FETCH-LOGICAL-a21148-d82e88d426afa890b6e87f4dbae5b71ec723ada88825dd272d60f7bdfd521f6a3
ISBN 9781680508604
1680508601
IngestDate Wed Dec 10 12:41:45 EST 2025
Sat Oct 25 05:15:58 EDT 2025
IsPeerReviewed false
IsScholarly false
Language English
LinkModel OpenURL
MergedId FETCHMERGED-LOGICAL-a21148-d82e88d426afa890b6e87f4dbae5b71ec723ada88825dd272d60f7bdfd521f6a3
OCLC 1505733269
1314614856
PQID EBC31929420
PageCount 356
ParticipantIDs proquest_ebookcentral_EBC6945696
proquest_ebookcentral_EBC31929420
PublicationCentury 2000
PublicationDate 2022
PublicationDateYYYYMMDD 2022-01-01
PublicationDate_xml – year: 2022
  text: 2022
PublicationDecade 2020
PublicationPlace La Vergne
PublicationPlace_xml – name: La Vergne
PublicationYear 2022
Publisher Pragmatic Programmers, LLC, The
Publisher_xml – name: Pragmatic Programmers, LLC, The
SSID ssib056664376
ssib060477334
ssib056722863
ssib058776731
ssj0003373234
Score 2.2584753
SourceID proquest
SourceType Publisher
Subtitle Simple, Rapid, Effective, and Scalable
TableOfContents Testing a Simple Python Script -- Testing an Importable Python Script -- Separating Code into src and tests Directories -- Defining the Python Search Path -- Testing requirements.txt-Based Applications -- Review -- Exercises -- What's Next -- 13. Debugging Test Failures -- Adding a New Feature to the Cards Project -- Installing Cards in Editable Mode -- Debugging with pytest Flags -- Re-Running Failed Tests -- Debugging with pdb -- Combining pdb and tox -- Review -- Exercises -- What's Next -- Part III-Booster Rockets -- 14. Third-Party Plugins -- Finding Plugins -- Installing Plugins -- Exploring the Diversity of pytest Plugins -- Running Tests in Parallel -- Randomizing Test Order -- Review -- Exercises -- What's Next -- 15. Building Plugins -- Starting with a Cool Idea -- Building a Local conftest Plugin -- Creating an Installable Plugin -- Testing Plugins with pytester -- Testing Multiple Python and pytest Versions with tox -- Publishing Plugins -- Review -- Exercises -- What's Next -- 16. Advanced Parametrization -- Using Complex Values -- Creating Custom Identifiers -- Parametrizing with Dynamic Values -- Using Multiple Parameters -- Using Indirect Parametrization -- Review -- Exercises -- What's Next -- A1. Virtual Environments -- A2. pip -- Index -- - SYMBOLS - -- - A - -- - B - -- - C - -- - D - -- - E - -- - F - -- - G - -- - H - -- - I - -- - L - -- - M - -- - N - -- - O - -- - P - -- - Q - -- - R - -- - S - -- - T - -- - U - -- - V - -- - W - -- - X - -- - Y -
Marking Files, Classes, and Parameters -- Using "and," "or," "not," and Parentheses with Markers -- Being Strict with Markers -- Combining Markers with Fixtures -- Listing Markers -- Review -- Exercises -- What's Next -- Part II-Working with Projects -- 7. Strategy -- Determining Test Scope -- Considering Software Architecture -- Evaluating the Features to Test -- Creating Test Cases -- Writing a Test Strategy -- Review -- Exercises -- What's Next -- 8. Configuration Files -- Understanding pytest Configuration Files -- Saving Settings and Flags in pytest.ini -- Using tox.ini, pyproject.toml, or setup.cfg in place of pytest.ini -- Determining a Root Directory and Config File -- Sharing Local Fixtures and Hook Functions with conftest.py -- Avoiding Test File Name Collision -- Review -- Exercises -- What's Next -- 9. Coverage -- Using coverage.py with pytest-cov -- Generating HTML Reports -- Excluding Code from Coverage -- Running Coverage on Tests -- Running Coverage on a Directory -- Running Coverage on a Single File -- Review -- Exercises -- What's Next -- 10. Mocking -- Isolating the Command-Line Interface -- Testing with Typer -- Mocking an Attribute -- Mocking a Class and Methods -- Keeping Mock and Implementation in Sync with Autospec -- Making Sure Functions Are Called Correctly -- Creating Error Conditions -- Testing at Multiple Layers to Avoid Mocking -- Using Plugins to Assist Mocking -- Review -- Exercises -- What's Next -- 11. tox and Continuous Integration -- What Is Continuous Integration? -- Introducing tox -- Setting Up tox -- Running tox -- Testing Multiple Python Versions -- Running tox Environments in Parallel -- Adding a Coverage Report to tox -- Specifying a Minimum Coverage Level -- Passing pytest Parameters Through tox -- Running tox with GitHub Actions -- Review -- Exercises -- What's Next -- 12. Testing Scripts and Applications
Cover -- Table of Contents -- Acknowledgments -- Preface -- Why pytest? -- Learn pytest While Testing a Sample Application -- How This Book Is Organized -- What You Need to Know -- Why a Second Edition? -- Example Code and Online Resources -- Part I-Primary Power -- 1. Getting Started with pytest -- Installing pytest -- Running pytest -- Review -- Exercises -- What's Next -- 2. Writing Test Functions -- Installing the Sample Application -- Writing Knowledge-Building Tests -- Using assert Statements -- Failing with pytest.fail() and Exceptions -- Writing Assertion Helper Functions -- Testing for Expected Exceptions -- Structuring Test Functions -- Grouping Tests with Classes -- Running a Subset of Tests -- Review -- Exercises -- What's Next -- 3. pytest Fixtures -- Getting Started with Fixtures -- Using Fixtures for Setup and Teardown -- Tracing Fixture Execution with -setup-show -- Specifying Fixture Scope -- Sharing Fixtures through conftest.py -- Finding Where Fixtures Are Defined -- Using Multiple Fixture Levels -- Using Multiple Fixtures per Test or Fixture -- Deciding Fixture Scope Dynamically -- Using autouse for Fixtures That Always Get Used -- Renaming Fixtures -- Review -- Exercises -- What's Next -- 4. Builtin Fixtures -- Using tmp_path and tmp_path_factory -- Using capsys -- Using monkeypatch -- Remaining Builtin Fixtures -- Review -- Exercises -- What's Next -- 5. Parametrization -- Testing Without Parametrize -- Parametrizing Functions -- Parametrizing Fixtures -- Parametrizing with pytest_generate_tests -- Using Keywords to Select Test Cases -- Review -- Exercises -- What's Next -- 6. Markers -- Using Builtin Markers -- Skipping Tests with pytest.mark.skip -- Skipping Tests Conditionally with pytest.mark.skipif -- Expecting Tests to Fail with pytest.mark.xfail -- Selecting Tests with Custom Markers
Title Python Testing with Pytest
URI https://ebookcentral.proquest.com/lib/[SITE_ID]/detail.action?docID=31929420
https://ebookcentral.proquest.com/lib/[SITE_ID]/detail.action?docID=6945696
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwtV3NS8MwFA9u8-DJb9z8oIJ4kUKbpkl63ZgKjtnDlN1G2qQiwzq7KfO_96VNW50IevASmhDS5L2X5L285P0QOpMud6Tirh0JN7FJjInNXaFszkksCIkcP45ysAk2HPLxOAgN3Ng8hxNgacqXy2D2r6yGMmC2fjr7B3ZXjUIBfAPTIQW2Q7qiEVfZguPhu44DcDHScTPKE1YoK_1H-iR1Oi1WmW5WSoUx-DFeMfjDTDwU0VzD4gbXkwFTGwx6xcUi9cVGdCl3QAujBcrvSnDpfrcHcxAHBDvnsxdbg3Fpp7VBJmmgBqOwbLSu-rd3N-U0BQVQe_tonWcY8zqKl891hKDauQh_ZszzNMBW1RfXRNuq-vZtK8z399EWain96GMbral0B22WUBeWWfl2UacgrmWIa2niWgVx99D9ZX_Uu7YNrIQtsLb-bMmx4lyCbiISwQMnooqzhMhIKD9irooZ9oQUHIwPX0rMsKROwiKZSNB1Eiq8fdRMn1N1gCziB1AV5D1WINzEBfNTSeH5ArQ8qajXRqflsCa599tcuZ18InwbWT_WoQEouAHt_KKZQ7RRS8sRai6yV3WM1uO3xeM8OzE8_ACIMRSX
linkProvider ProQuest Ebooks
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.title=Python+Testing+with+Pytest&rft.au=Okken%2C+Brian&rft.date=2022-01-01&rft.pub=Pragmatic+Programmers%2C+LLC%2C+The&rft.isbn=9781680508604&rft.externalDocID=EBC31929420
thumbnail_l http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781680508604/lc.gif&client=summon&freeimage=true
thumbnail_m http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781680508604/mc.gif&client=summon&freeimage=true
thumbnail_s http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781680508604/sc.gif&client=summon&freeimage=true