Skip to main content

Supports soft assertions in extending the unittest.TestCase class

Project description

softest - Soft Assertions

Supports the soft assert style of testing, where multiple assertions can fail within the same method, while collecting and formatting those failures' stack traces for reporting by a final assert_all call.

Such stack traces are enhanced to include the call hierarchy from within the test class.

Usage

import softest

class ExampleTest(softest.SoftTestCase):
	def test_example(self):
		self.soft_assert(self.assertEqual, 'Worf', 'wharf', 'Klingon is not ship receptacle')
		self.soft_assert(self.assertTrue, True)
		self.soft_assert(self.assertTrue, False)

		self.assert_all()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

softest-1.0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

softest-1.0.0.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page