Документация Python неофициальный перевод

development.md

72 строк · 7.7 КБ · обычная страница · сырой текст · скачать

1> **Источник:** https://python-all.ru/3.2/library/development.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# 25. Инструменты разработки89Модули, описанные в этой главе, помогают разрабатывать программное обеспечение. Например, модуль [`pydoc`](https://python-all.ru/3.2/library/pydoc.html#module-pydoc) принимает модуль и генерирует документацию на основе его содержимого. Модули [`doctest`](https://python-all.ru/3.2/library/doctest.html#module-doctest) и [`unittest`](https://python-all.ru/3.2/library/unittest.html#module-unittest) содержат фреймворки для написания модульных тестов, которые автоматически выполняют код и проверяют, что выводится ожидаемый результат. **2to3** может транслировать исходный код Python 2.x в корректный код Python 3.x.1011Список модулей, описанных в этой главе:1213- [25.1. `pydoc` – Генератор документации и справочная система](https://python-all.ru/3.2/library/pydoc.html)14- [25.2. `doctest` – Тестирование интерактивных примеров Python](https://python-all.ru/3.2/library/doctest.html)1516  - [25.2.1. Простое использование: проверка примеров в docstrings](https://python-all.ru/3.2/library/doctest.html#simple-usage-checking-examples-in-docstrings)17  - [25.2.2. Простое использование: проверка примеров в текстовом файле](https://python-all.ru/3.2/library/doctest.html#simple-usage-checking-examples-in-a-text-file)18  - [25.2.3. Как это работает](https://python-all.ru/3.2/library/doctest.html#how-it-works)1920    - [25.2.3.1. Какие docstrings проверяются?](https://python-all.ru/3.2/library/doctest.html#which-docstrings-are-examined)21    - [25.2.3.2. Как распознаются примеры в строках документации?](https://python-all.ru/3.2/library/doctest.html#how-are-docstring-examples-recognized)22    - [25.2.3.3. Каков контекст выполнения?](https://python-all.ru/3.2/library/doctest.html#what-s-the-execution-context)23    - [25.2.3.4. А что насчёт исключений?](https://python-all.ru/3.2/library/doctest.html#what-about-exceptions)24    - [25.2.3.5. Флаги опций и директивы](https://python-all.ru/3.2/library/doctest.html#option-flags-and-directives)25    - [25.2.3.6. Предупреждения](https://python-all.ru/3.2/library/doctest.html#warnings)26  - [25.2.4. Базовый API](https://python-all.ru/3.2/library/doctest.html#basic-api)27  - [25.2.5. Unittest API](https://python-all.ru/3.2/library/doctest.html#unittest-api)28  - [25.2.6. Продвинутый API](https://python-all.ru/3.2/library/doctest.html#advanced-api)2930    - [25.2.6.1. Объекты DocTest](https://python-all.ru/3.2/library/doctest.html#doctest-objects)31    - [25.2.6.2. Объекты Example](https://python-all.ru/3.2/library/doctest.html#example-objects)32    - [25.2.6.3. Объекты DocTestFinder](https://python-all.ru/3.2/library/doctest.html#doctestfinder-objects)33    - [25.2.6.4. Объекты DocTestParser](https://python-all.ru/3.2/library/doctest.html#doctestparser-objects)34    - [25.2.6.5. Объекты DocTestRunner](https://python-all.ru/3.2/library/doctest.html#doctestrunner-objects)35    - [25.2.6.6. Объекты OutputChecker](https://python-all.ru/3.2/library/doctest.html#outputchecker-objects)36  - [25.2.7. Отладка](https://python-all.ru/3.2/library/doctest.html#debugging)37  - [25.2.8. Разное](https://python-all.ru/3.2/library/doctest.html#soapbox)38- [25.3. `unittest` – фреймворк для модульного тестирования](https://python-all.ru/3.2/library/unittest.html)3940  - [25.3.1. Простой пример](https://python-all.ru/3.2/library/unittest.html#basic-example)41  - [25.3.2. Интерфейс командной строки](https://python-all.ru/3.2/library/unittest.html#command-line-interface)4243    - [25.3.2.1. Параметры командной строки](https://python-all.ru/3.2/library/unittest.html#command-line-options)44  - [25.3.3. Обнаружение тестов](https://python-all.ru/3.2/library/unittest.html#test-discovery)45  - [25.3.4. Организация тестового кода](https://python-all.ru/3.2/library/unittest.html#organizing-test-code)46  - [25.3.5. Повторное использование старого тестового кода](https://python-all.ru/3.2/library/unittest.html#re-using-old-test-code)47  - [25.3.6. Пропуск тестов и ожидаемые сбои](https://python-all.ru/3.2/library/unittest.html#skipping-tests-and-expected-failures)48  - [25.3.7. Классы и функции](https://python-all.ru/3.2/library/unittest.html#classes-and-functions)4950    - [25.3.7.1. Тестовые примеры](https://python-all.ru/3.2/library/unittest.html#test-cases)5152      - [25.3.7.1.1. Устаревшие псевдонимы](https://python-all.ru/3.2/library/unittest.html#deprecated-aliases)53    - [25.3.7.2. Группировка тестов](https://python-all.ru/3.2/library/unittest.html#grouping-tests)54    - [25.3.7.3. Загрузка и запуск тестов](https://python-all.ru/3.2/library/unittest.html#loading-and-running-tests)5556      - [25.3.7.3.1. Протокол load\_tests](https://python-all.ru/3.2/library/unittest.html#load-tests-protocol)57  - [25.3.8. Фикстуры классов и модулей](https://python-all.ru/3.2/library/unittest.html#class-and-module-fixtures)5859    - [25.3.8.1. setUpClass и tearDownClass](https://python-all.ru/3.2/library/unittest.html#setupclass-and-teardownclass)60    - [25.3.8.2. setUpModule и tearDownModule](https://python-all.ru/3.2/library/unittest.html#setupmodule-and-teardownmodule)61  - [25.3.9. Обработка сигналов](https://python-all.ru/3.2/library/unittest.html#signal-handling)62- [25.4. 2to3 – автоматическое преобразование кода Python 2 в 3](https://python-all.ru/3.2/library/2to3.html)6364  - [25.4.1. Использование 2to3](https://python-all.ru/3.2/library/2to3.html#using-2to3)65  - [25.4.2. Исправители](https://python-all.ru/3.2/library/2to3.html#fixers)66  - [25.4.3. `lib2to3` – библиотека 2to3](https://python-all.ru/3.2/library/2to3.html#module-lib2to3)67- [25.5. `test` – пакет регрессионных тестов для Python](https://python-all.ru/3.2/library/test.html)6869  - [25.5.1. Написание модульных тестов для пакета `test`](https://python-all.ru/3.2/library/test.html#writing-unit-tests-for-the-test-package)70  - [25.5.2. Запуск тестов с помощью интерфейса командной строки](https://python-all.ru/3.2/library/test.html#running-tests-using-the-command-line-interface)71- [25.6. `test.support` – Утилиты для набора тестов Python](https://python-all.ru/3.2/library/test.html#module-test.support)72