File: sample_test.py

package info (click to toggle)
python-rednose 0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 104 kB
  • sloc: python: 324; makefile: 19
file content (30 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# vim: set fileencoding=utf-8 :
from __future__ import print_function
from __future__ import unicode_literals
import unittest

def delay_fail(f):
	f() # fail it!

class SomeTest(unittest.TestCase):
	def test_fail(self):
		print("oh noes, it's gonna blow!")
		delay_fail(lambda: self.fail('no dice'))
	
	def test_success(self):
		self.assertEqual(True, True)
	
	def test_error(self):
		raise RuntimeError("things went south\nand here's a second line!")

	def test_utf8(self):
		self.assertEqual('café', 'abc')
	
	def test_skip(self):
		import nose
		raise nose.SkipTest
	
	def test_with_long_description(self):
		"""It's got a long description, you see?"""
		self.fail()