Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def test_EXPECTED_TEXT_is_present(self):
self.assertTrue(any(contains_ready))

def test_process_names(self):
self.assertIn('terminating_proc.py-1', self.proc_output.process_names())
self.assertIn('terminating_proc.py-2', self.proc_output.process_names())
self.assertIn('terminating_proc.py-3', self.proc_output.process_names())
self.assertIn(self.proc_1.name, self.proc_output.process_names())
self.assertIn(self.proc_2.name, self.proc_output.process_names())
self.assertIn(self.proc_3.name, self.proc_output.process_names())

def test_processes(self):
self.assertIn(self.proc_1, self.proc_output.processes())
Expand All @@ -143,18 +143,18 @@ def test_assertInStdout_notices_no_matching_proc(self):
print(cm.exception)

# Make sure the assertion method lists the names of the process it does have:
self.assertIn('terminating_proc.py-1', str(cm.exception))
self.assertIn('terminating_proc.py-2', str(cm.exception))
self.assertIn('terminating_proc.py-3', str(cm.exception))
self.assertIn(self.proc_1.name, str(cm.exception))
self.assertIn(self.proc_2.name, str(cm.exception))
self.assertIn(self.proc_3.name, str(cm.exception))

def test_assertInStdout_notices_too_many_matching_procs(self):
with self.assertRaisesRegex(Exception, 'Found multiple processes') as cm:
assertInStdout(self.proc_output, self.EXPECTED_TEXT, 'terminating_proc.py')

# Make sure the assertion method lists the names of the duplicate procs:
self.assertIn('terminating_proc.py-1', str(cm.exception))
self.assertIn('terminating_proc.py-2', str(cm.exception))
self.assertIn('terminating_proc.py-3', str(cm.exception))
self.assertIn(self.proc_1.name, str(cm.exception))
self.assertIn(self.proc_2.name, str(cm.exception))
self.assertIn(self.proc_3.name, str(cm.exception))

def test_strict_proc_matching_false(self):
assertInStdout(
Expand All @@ -168,7 +168,7 @@ def test_regex_matching(self):
assertInStdout(
self.proc_output,
re.compile(r'Called with arguments \S+'),
'terminating_proc.py-2'
self.proc_2.name
)

def test_arguments_disambiguate_processes(self):
Expand All @@ -181,7 +181,7 @@ def test_arguments_disambiguate_processes(self):

def test_asserts_on_missing_text(self):
with self.assertRaisesRegex(AssertionError, self.NOT_FOUND_TEXT):
assertInStdout(self.proc_output, self.NOT_FOUND_TEXT, 'terminating_proc.py-1')
assertInStdout(self.proc_output, self.NOT_FOUND_TEXT, self.proc_1.name)

def test_asserts_on_missing_text_by_proc(self):
with self.assertRaisesRegex(AssertionError, self.NOT_FOUND_TEXT):
Expand Down