| 766 | |
| 767 | |
| 768 | class CustomTestItem(TestItem): |
| 769 | |
| 770 | def __init__( |
| 771 | self, |
| 772 | nodeid, |
| 773 | location, |
| 774 | test_suffix, |
| 775 | keywords=None, |
| 776 | callspec=None, |
| 777 | pytest_class=None, |
| 778 | file_path=None, |
| 779 | ): |
| 780 | self._result = None |
| 781 | self.nodeid = nodeid |
| 782 | self._location = location |
| 783 | self._class_name, self._test_name = tools.split_node_id(nodeid, test_suffix) |
| 784 | self._duration = 0 |
| 785 | self._error = "" |
| 786 | self._keywords = keywords if keywords is not None else {} |
| 787 | self._callspec = callspec |
| 788 | self._pytest_class = pytest_class |
| 789 | self._file_path = file_path |
| 790 | |
| 791 | @property |
| 792 | def location(self): |
| 793 | return self._location[0] |
| 794 | |
| 795 | @property |
| 796 | def location_number(self): |
| 797 | return self._location[1] + 1 |
| 798 | |
| 799 | @property |
| 800 | def markers(self): |
| 801 | return [m.name for m in self._markers] |
| 802 | |
| 803 | @property |
| 804 | def params(self): |
| 805 | return self._callspec.id if self._callspec else None |
| 806 | |
| 807 | @property |
| 808 | def pytest_class(self): |
| 809 | return self._pytest_class |
| 810 | |
| 811 | @property |
| 812 | def file_path(self): |
| 813 | return str(self._file_path) |
| 814 | |
| 815 | @property |
| 816 | def node_id(self): |
| 817 | file_name = os.path.basename(self._location[0]) |
| 818 | return "{}::{}".format(file_name, self.test_name) |
| 819 | |
| 820 | |
| 821 | class NotLaunchedTestItem(CustomTestItem): |
no outgoing calls
no test coverage detected