File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -621,11 +621,15 @@ def test_clear(self):
621621 self .assertEqual (None , self .registry .get_sample_value ('c_total' , {'l' : 'y' }))
622622
623623 def test_clear_no_labels_raises (self ):
624- """clear() on a metric without labels should raise ValueError, not AttributeError."""
625624 no_labels = Counter ('c_no_labels' , 'help' , registry = self .registry )
626625 no_labels .inc ()
627626 self .assertRaises (ValueError , no_labels .clear )
628627
628+ def test_remove_no_labels_raises (self ):
629+ no_labels = Counter ('c_no_labels2' , 'help' , registry = self .registry )
630+ no_labels .inc ()
631+ self .assertRaises (ValueError , no_labels .remove , 'x' )
632+
629633 def test_incorrect_label_count_raises (self ):
630634 self .assertRaises (ValueError , self .counter .labels )
631635 self .assertRaises (ValueError , self .counter .labels , 'a' , 'b' )
You can’t perform that action at this time.
0 commit comments