()
| 29 | |
| 30 | |
| 31 | def test_no_plotly(): |
| 32 | model = BERTopic( |
| 33 | language="Dutch", |
| 34 | embedding_model=None, |
| 35 | min_topic_size=2, |
| 36 | top_n_words=1, |
| 37 | umap_model=BaseDimensionalityReduction(), |
| 38 | ) |
| 39 | model.fit(["hello", "hi", "goodbye", "goodbye", "whats up"] * 10) |
| 40 | |
| 41 | try: |
| 42 | out = model.visualize_topics() |
| 43 | assert isinstance(out, Figure) if Figure else False |
| 44 | except ImportError as e: |
| 45 | assert "Plotly is required to use" in str(e) |
nothing calls this directly
no test coverage detected