()
| 161 | |
| 162 | |
| 163 | def test_info_method_heading(): |
| 164 | # info(class) should only print "Methods:" heading if methods exist |
| 165 | |
| 166 | class NoPublicMethods: |
| 167 | pass |
| 168 | |
| 169 | class WithPublicMethods: |
| 170 | def first_method(): |
| 171 | pass |
| 172 | |
| 173 | def _has_method_heading(cls): |
| 174 | out = StringIO() |
| 175 | utils.info(cls, output=out) |
| 176 | return 'Methods:' in out.getvalue() |
| 177 | |
| 178 | assert _has_method_heading(WithPublicMethods) |
| 179 | assert not _has_method_heading(NoPublicMethods) |
| 180 | |
| 181 | |
| 182 | def test_drop_metadata(): |
nothing calls this directly
no test coverage detected