使用 Pytest 实现真实世界的 Python 测试自动化(Django 应用)
通过使用持续集成系统构建完整的 Django 应用程序、软件测试最佳实践来学习 Pytest
教程演示🔗
What you’ll learn 学习内容
-
Learn the ins and outs of Pytest
了解Pytest的来龙去脉 -
Build a real world Django web server
构建真实世界的 Django Web 服务器 -
Build a continuous integration system
构建持续集成系统 -
Testing Best Practices 测试最佳实践
-
Build high-performing, reliable automated test suites
构建高性能、可靠的自动化测试套件 -
Allure Reporting 诱惑报告
-
Slack messaging Slack 消息传递
-
Unit, Integration, E2E, performance tests
单元、集成、E2E、性能测试 -
Mocking and Patching模拟和修补
Requirements 要求
-
Advanced knowledge of python – This is NOT a beginner course
python 的高级知识 – 这不是初学者课程
Description 描述
This is a MUST course for anyone who cares about testing.
对于任何关心测试的人来说,这都是一门必修课。
I teach the ins and outs of pytest while building a real-world Django application (including a continuous integration system in bitbucket).
我在构建一个真实世界的 Django 应用程序(包括 bitbucket 中的持续集成系统)时教授 pytest 的来龙去脉。
In this course, we will build a very simple Django server, I will teach just enough Django so that we will be able to build the application and then focus on testing it.
在本课程中,我们将构建一个非常简单的 Django 服务器,我将教授足够的 Django,以便我们能够构建应用程序,然后专注于测试它。
We will together test the application from all angels – Unit tests, integration tests, API tests, end-to-end tests , and performance tests with (a total of over 40 tests)
我们将从所有天使那里共同测试应用程序 – 单元测试、集成测试、API 测试、端到端测试和性能测试(总共超过 40 个测试)
You will end up with a complete CI system that integrates bitbucket cloud pipelines, slack messaging, and allure reporting.
您最终将获得一个完整的 CI 系统,该系统集成了 bitbucket 云管道、Slack 消息传递和诱惑报告。
Every time we will make a push, the CI system will run our tests and will notify us if the build passed/failed.
每次我们进行推送时,CI 系统都会运行我们的测试,并在构建通过/失败时通知我们。
In this course, we go in-depth, and we will even implement together (from scratch) some of pytest’s features so that we will know what happens under the hood when pytest is running our tests.
在本课程中,我们将深入探讨,我们甚至将一起(从头开始)实现 pytest 的一些功能,以便我们知道当 pytest 运行我们的测试时在后台会发生什么。
This is not an entry-level course; basic knowledge of python is needed
这不是入门级课程;需要 Python 的基本知识
You will learn:
您将学习:
Pytest features (in-depth)
Pytest 功能(深入)
-
Fixtures 夹具
-
Markers 标记
-
Parametrize 参数化
-
Skip, xfail 跳过,xfail
-
Pytest.ini
-
Pytest-django
-
Pytest-cov
-
pytest-xdist
-
unittest library, mocks 单元测试库,模拟
-
Requests library 请求库
Django (just enough to build a web server)
Django(刚好够构建一个 Web 服务器)
-
Rest API 休息 API
-
Models, Migrations 模型、迁移
-
Views 视图
-
Serializers 序列化程序
-
SQLite3 DB SQLite3数据库
-
Email backends 电子邮件后端
Continuous Integration (in-depth)
持续集成(深入)
-
Bitbucket pipelines Bitbucket 管道
-
Bitbucket environment variables
Bitbucket 环境变量 -
Parallel steps 并行步骤
-
Docker 码头工人
-
Slack messaging integration
Slack 消息传递集成 -
Allure Reporting 诱惑报告
Testing (In-depth) 测试(深入)
-
Unit tests 单元测试
-
Mocking. Patching, Stubs 嘲笑。修补、存根
-
Integration tests 集成测试
-
Performance tests 性能测试
-
Testing environments 测试环境
Python best practice Python 最佳实践
-
Virtual environments: pipenv
虚拟环境:pipenv -
Pipfile
-
Type hinting 类型提示
-
Black formatter 黑色格式化程序
-
.env File .env 文件
Recreating react our projects UI (No prior knowledge is needed
重新创建 react 我们的项目 UI(不需要先验知识
Who this course is for:
本课程适用于谁:
- Developers who are interested in writing quality tests for their applications
有兴趣为其应用程序编写质量测试的开发人员 - Python Developers curious about Pytest
Python 开发人员对 Pytest 感到好奇 - Anyone who wants to build or improve an automated testing framework
任何想要构建或改进自动化测试框架的人 - QA Engineers who wants to learn about pytest
想要了解pytest的QA工程师