Skip to content

Commit

Permalink
OWLouvain: Fix tests not waiting for commit to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlin-policar committed Aug 1, 2018
1 parent 86ce71b commit 6a0c36f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Orange/widgets/unsupervised/owlouvainclustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def commit(self):
self.__future = self.__executor.submit(queue.start)

def _send_data(self):
domain = self.data.domain
if self.partition is None:
if self.partition is None or self.data is None:
return
domain = self.data.domain
# Compute the frequency of each cluster index
counts = np.bincount(self.partition)
indices = np.argsort(counts)[::-1]
Expand Down
3 changes: 1 addition & 2 deletions Orange/widgets/unsupervised/tests/test_owlouvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_clusters_ordered_by_size(self):

self.send_signal(self.widget.Inputs.data, table)
self.widget.k_neighbors = 4
self.widget.unconditional_commit()
self.commit_and_wait()
output = self.get_output(self.widget.Outputs.annotated_data)

Expand All @@ -57,7 +56,7 @@ def test_empty_dataset(self):
table.get_column_view(meta_var)[0][:] = meta

self.send_signal(self.widget.Inputs.data, table)
self.widget.unconditional_commit()
self.commit_and_wait()
self.assertTrue(self.widget.Error.empty_dataset.is_shown())

def test_do_not_recluster_on_same_data(self):
Expand Down

0 comments on commit 6a0c36f

Please sign in to comment.