Update pytest to 9.0.3 (#375)
Summary: Validate that CI passes
Pull Request resolved: https://github.com/facebook/TestSlide/pull/375
Differential Revision: D102792375
Pulled By: oxo42
fbshipit-source-id: 1f2085001237f5853a9d92c3bb5a9cf4db2ddab0
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
A test framework for Python that enable unit testing / TDD / BDD to be productive and enjoyable.
Its well behaved mocks with thorough API validations catches bugs both when code is first written or long in the future when it is changed.
The flexibility of using them with existing
unittest.TestCaseor TestSlide’s own test runner let users get its benefits without requiring refactoring existing code.Quickstart
Install:
Scaffold the code you want to test
backup.py:Write a test case
backup_test.pydescribing the expected behavior:TestSlide’s
StrictMock,mock_constructor()andmock_callable()are seamlessly integrated with Python’s TestCase.Run the test and see the failure:
TestSlide’s mocks failure messages guide you towards the solution, that you can now implement:
And watch the test go green:
It is all about letting the failure messages guide you towards the solution. There’s a plethora of validation inside TestSlide’s mocks, so you can trust they will help you iterate quickly when writing code and also cover you when breaking changes are introduced.
Full documentation
There’s a lot more that TestSlide can offer, please check the full documentation at https://testslide.readthedocs.io/ to learn more.
Requirements
Join the TestSlide community
TestSlide is open source software, contributions are very welcome!
See the CONTRIBUTING file for how to help out.
License
TestSlide is MIT licensed, as found in the LICENSE file.
Terms of Use
https://opensource.facebook.com/legal/terms
Privacy Policy
https://opensource.facebook.com/legal/privacy
Copyright
Copyright © 2021 Meta Platforms, Inc