Skip to content

Conversation

mMerlin
Copy link
Contributor

@mMerlin mMerlin commented Feb 28, 2024

This is a collection of small updates I added to my own copy of unittest.py to handle missing and broken cases noticed while using it.

  • handle and report exception running test method that occurs outside of assertraises
  • allow running testmodules from a sub folder instead of only in the root
  • add a tests folder and duplicate example unit test to demonstrate subfolder usage
  • skip looking for tests earlier if TestCase shows up in a module search (versus subclass)
  • properly pass skip reason message to raised exception
  • add new options for running to the README
  • add whitespace to the readme markdown to make the linter happy
  • move TestResults class before first reference in the module
  • implement bare (do nothing) hooks in the TestCase base class
  • move core test method run loop from run_class to TestCase.run
  • rewrite run_class: execute new hooks for setUpClass, run, tearDownClass; add exception handling
  • add missing assertNotIn method to TestCase class
  • provide more detail when exceptions trapped for hooks
  • fix traceback reporting for TestCase hook exceptions
  • report traceback on exceptions outside assertrasises when running test methods
  • fix AssertRaisesContext
  • handle assertion failure that does not have any message
Duplicate test_code in tests folder for sample and test Early skip if TestCase shows up in module Properly pass skip reason message to raised exception Add new running options to README Add whitespace to README, to make the linter happy.
implement bare hooks in TestCase base class move core test method run loop from run_class to TestCase.run rewrite run_class: execute hooks setUpClass, run, tearDownClass; add exception handling
@mytechnotalent mytechnotalent merged commit 119398b into mytechnotalent:main Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants