About 1,210,000 results
Open links in new tab
  1. unittest — Unit testing framework — Python 3.13.3 documentation

    3 days ago · The basic building blocks of unit testing are test cases — single scenarios that must be set up and checked for correctness. In unittest, test cases are represented by …

  2. Getting Python's unittest results in a tearDown () method

    Dec 10, 2010 · If you take a look at the implementation of unittest.TestCase.run, you can see that all test results are collected in the result object (typically a unittest.TestResult instance) passed …

  3. How to retrieve the TestResult object from a python unittest?

    Here is some example code that you can run: def test_it(self): self.assertTrue(1==2) def tearDown(self): print("Get test results and log them here") print(unittest.TestResult()) …

  4. python - How to get the result of an individual test case ... - Stack ...

    May 20, 2014 · Is there a way of getting the result of an individual test case? I want to log the name of each test case and if it passed or not. I do not want to spend time writing into the log …

  5. How To Use unittest to Write a Test Case for a Function in Python

    Oct 1, 2020 · In this tutorial, you will use Python’s unittest module to write a test for a function. To get the most out of this tutorial, you’ll need: An understanding of functions in Python. You can …

  6. Python's unittest: Writing Unit Tests for Your Code

    Apr 29, 2024 · Test case: An individual unit of testing. It examines the output for a given input set. Test suite: A collection of test cases, test suites, or both.

  7. Writing Test Cases in Python for Beginners - Medium

    Mar 3, 2025 · Python provides a built-in module called unittest to help you write tests. In this blog, we’ll learn how to write simple test cases and use mock to test functions that rely on external …

  8. Lesson 79: Creating Test Cases - Kinda Technical

    This lesson will guide you through building effective test cases using Python's unittest framework. Why Are Test Cases Important? Test cases help you verify that your code runs as intended …

  9. Building simple test cases in Python using unittest library

    Feb 1, 2025 · Introduction to Python test cases: In Python code development, building test cases in another aspect of creating quality and robust softwares. In this article I will show step by …

  10. Python unittest - Writing and Running Unit Tests in Python

    Feb 25, 2025 · This method uses assertEqual to verify that 1 + 1 equals 2. When executed via unittest.main(), the test runner checks this assertion and reports the result. Run the tests from …

  11. Some results have been removed
Refresh