(model, request)
| 14 | ], |
| 15 | ) |
| 16 | def test_generate_topic_labels(model, request): |
| 17 | topic_model = copy.deepcopy(request.getfixturevalue(model)) |
| 18 | labels = topic_model.generate_topic_labels(topic_prefix=False) |
| 19 | |
| 20 | assert sum([label[0].isdigit() for label in labels[1:]]) / len(labels) < 0.2 |
| 21 | |
| 22 | labels = [int(label.split("_")[0]) for label in topic_model.generate_topic_labels()] |
| 23 | assert labels == sorted(list(set(topic_model.topics_))) |
| 24 | |
| 25 | labels = topic_model.generate_topic_labels(nr_words=1, topic_prefix=False) |
| 26 | assert all([True if len(label) < 15 else False for label in labels]) |
| 27 | |
| 28 | |
| 29 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected