Alat Pengembangan
*****************

Modul yang dijelaskan dalam bab ini membantu Anda menulis perangkat
lunak. Sebagai contoh, modul "pydoc" mengambil modul dan menghasilkan
dokumentasi berdasarkan isi modul. Modul "doctest" dan "unittest"
berisi kerangka kerja untuk penulisan unit test yang secara otomatis
menjalankan kode dan memverifikasi bahwa output yang diharapkan
dihasilkan. **2to3** dapat menerjemahkan kode Python 2.x menjadi kode
Python 3.x yang valid.

Daftar modul yang dijelaskan di dalam bab ini adalah:

* "typing" --- Support for type hints

  * Relevant PEPs

  * Type aliases

  * NewType

  * Callable

  * Generics

  * User-defined generic types

  * The "Any" type

  * Nominal vs structural subtyping

  * Module contents

    * Special typing primitives

      * Special types

      * Special forms

      * Building generic types

      * Other special directives

    * Generic concrete collections

      * Corresponding to built-in types

      * Corresponding to types in "collections"

      * Other concrete types

    * Abstract Base Classes

      * Corresponding to collections in "collections.abc"

      * Corresponding to other types in "collections.abc"

      * Asynchronous programming

      * Context manager types

    * Protocols

    * Functions and decorators

    * Introspection helpers

    * Konstanta

* "pydoc" --- Documentation generator and online help system

* Python Development Mode

* Effects of the Python Development Mode

* ResourceWarning Example

* Bad file descriptor error example

* "doctest" --- Contoh uji interaktif Python

  * Simple Usage: Checking Examples in Docstrings

  * Penggunaan Sederhana: Memeriksa Contoh di Berkas Teks

  * Bagaimana Itu Bekerja

    * Docstrings Mana yang Diperiksa?

    * Bagaimana Contoh Docstring Dikenali?

    * Apa itu Konteks Eksekusi?

    * Bagaimana dengan Pengecualian?

    * Penanda Opsi

    * Petunjuk

    * Peringatan

  * Basic API

  * Unittest API

  * Advanced API

    * DocTest Objects

    * Example Objects

    * DocTestFinder objects

    * DocTestParser objects

    * DocTestRunner objects

    * OutputChecker objects

  * Debugging

  * Soapbox

* "unittest" --- Unit testing framework

  * Contoh dasar

  * Command-Line Interface

    * Command-line options

  * Test Discovery

  * Organizing test code

  * Re-using old test code

  * Skipping tests and expected failures

  * Distinguishing test iterations using subtests

  * Classes and functions

    * Kasus pengujian

      * Deprecated aliases

    * Grouping tests

    * Loading and running tests

      * load_tests Protocol

  * Class and Module Fixtures

    * setUpClass and tearDownClass

    * setUpModule and tearDownModule

  * Penanganan Sinyal *Signal*

* "unittest.mock" --- mock object library

  * Quick Guide

  * The Mock Class

    * Calling

    * Deleting Attributes

    * Mock names and the name attribute

    * Attaching Mocks as Attributes

  * The patchers

    * patch

    * patch.object

    * patch.dict

    * patch.multiple

    * patch methods: start and stop

    * patch builtins

    * TEST_PREFIX

    * Nesting Patch Decorators

    * Where to patch

    * Patching Descriptors and Proxy Objects

  * MagicMock and magic method support

    * Mocking Magic Methods

    * Magic Mock

  * Helpers

    * sentinel

    * DEFAULT

    * call

    * create_autospec

    * ANY

    * FILTER_DIR

    * mock_open

    * Autospeccing

    * Sealing mocks

* "unittest.mock" --- getting started

  * Using Mock

    * Mock Patching Methods

    * Mock for Method Calls on an Object

    * Mocking Classes

    * Naming your mocks

    * Tracking all Calls

    * Setting Return Values and Attributes

    * Raising exceptions with mocks

    * Side effect functions and iterables

    * Mocking asynchronous iterators

    * Mocking asynchronous context manager

    * Creating a Mock from an Existing Object

  * Patch Decorators

  * Further Examples

    * Mocking chained calls

    * Partial mocking

    * Mocking a Generator Method

    * Applying the same patch to every test method

    * Mocking Unbound Methods

    * Checking multiple calls with mock

    * Coping with mutable arguments

    * Nesting Patches

    * Mocking a dictionary with MagicMock

    * Mock subclasses and their attributes

    * Mocking imports with patch.dict

    * Tracking order of calls and less verbose call assertions

    * More complex argument matching

* 2to3 - Automated Python 2 to 3 code translation

  * Menggunakan 2to3

  * Fixers

  * "lib2to3" - 2to3's library

* "test" --- Regression tests package for Python

  * Writing Unit Tests for the "test" package

  * Running tests using the command-line interface

* "test.support" --- Utilities for the Python test suite

* "test.support.socket_helper" --- Utilities for socket tests

* "test.support.script_helper" --- Utilities for the Python execution
  tests

* "test.support.bytecode_helper" --- Support tools for testing correct
  bytecode generation
