| 663 | self.popen.wait(timeout=timeout) |
| 664 | |
| 665 | def fnmatch_lines(self, pattern_lines): |
| 666 | patterns = [x.strip() for x in Source(pattern_lines.rstrip()).lines if x.strip()] |
| 667 | for next_pattern in patterns: |
| 668 | print("+++FNMATCH:", next_pattern) |
| 669 | ignored = [] |
| 670 | while True: |
| 671 | line = self.stdout_queue.get() |
| 672 | if line is None: |
| 673 | if ignored: |
| 674 | print("BOT stdout terminated after these lines") |
| 675 | for line in ignored: |
| 676 | print(line) |
| 677 | raise IOError("BOT stdout-thread terminated") |
| 678 | if fnmatch.fnmatch(line, next_pattern): |
| 679 | print("+++MATCHED:", line) |
| 680 | break |
| 681 | else: |
| 682 | print("+++IGN:", line) |
| 683 | ignored.append(line) |
| 684 | |
| 685 | |
| 686 | @pytest.fixture() |