nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: matrixorigin/matrixone
Pull request #14252 (2024-01-17 09:27:54)

augment the `hakeeperDefaultTimeout` in ut to avoid `TestHAKeeperCanBootstrapAndRepairShards` failed
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/matrixone/issues/8438

## What this PR does / why we need it:

augment the `hakeeperDefaultTimeout` to avoid `TestHAKeeperCanBootstrapAndRepairShards` failed.

this change only happened when UT.

cherry-pick to 1.1: https://github.com/matrixorigin/matrixone/pull/14253



Patch:
diff --git a/pkg/logservice/store_hakeeper_check.go b/pkg/logservice/store_hakeeper_check.go
index 461cd671a..745625ccc 100644
--- a/pkg/logservice/store_hakeeper_check.go
+++ b/pkg/logservice/store_hakeeper_check.go
@@ -30,11 +30,13 @@ import (
 )
 
 const (
-	minIDAllocCapacity uint64 = 1024
-	defaultIDBatchSize uint64 = 1024 * 10
+	minIDAllocCapacity   uint64 = 1024
+	defaultIDBatchSize   uint64 = 1024 * 10
+	checkBootstrapCycles        = 100
+)
 
+var (
 	hakeeperDefaultTimeout = 2 * time.Second
-	checkBootstrapCycles   = 100
 )
 
 type idAllocator struct {


Test patch:
diff --git a/pkg/logservice/store_hakeeper_check_test.go b/pkg/logservice/store_hakeeper_check_test.go
index 604e3cf30..6277d6836 100644
--- a/pkg/logservice/store_hakeeper_check_test.go
+++ b/pkg/logservice/store_hakeeper_check_test.go
@@ -277,6 +277,8 @@ func TestHAKeeperCanBootstrapAndRepairShards(t *testing.T) {
 	fn := func(t *testing.T, services []*Service) {
 		// bootstrap the cluster, 1 TN 1 Log shard, Log and HAKeeper have
 		// 3 replicas
+		hakeeperDefaultTimeout = 10 * time.Second
+
 		store1 := services[0].store
 		state, err := store1.getCheckerState()
 		require.NoError(t, err)
Repository: redhat-openshift-ecosystem/openshift-preflight
Pull request #227 (2021-09-09 19:24:59)

Fix the license check so that failures vs errors are correct
If the license dir did not exist, it was being reports as an error. It
is supposed to be a failure. If /licenses is not a dir, that a failure,
not an error. If the dir can't be read, then that's treated as a failure.

Signed-off-by: Brad P. Crochet <brad@redhat.com>


Patch:
diff --git a/certification/internal/policy/container/has_license.go b/certification/internal/policy/container/has_license.go
index 17f4045..ec2db70 100644
--- a/certification/internal/policy/container/has_license.go
+++ b/certification/internal/policy/container/has_license.go
@@ -1,6 +1,7 @@
 package container
 
 import (
+	stdliberrors "errors"
 	"fmt"
 	"io/fs"
 	"os"
@@ -24,6 +25,9 @@ type HasLicenseCheck struct{}
 func (p *HasLicenseCheck) Validate(imgRef certification.ImageReference) (bool, error) {
 	licenseFileList, err := p.getDataToValidate(imgRef.ImageFSPath)
 	if err != nil {
+		if stdliberrors.Is(err, fs.ErrNotExist) || stdliberrors.Is(err, errors.ErrLicensesNotADir) {
+			return false, nil
+		}
 		return false, err
 	}
 	return p.validate(licenseFileList)


Test patch:
diff --git a/certification/internal/policy/container/has_license_test.go b/certification/internal/policy/container/has_license_test.go
index 69713f1..c394b36 100644
--- a/certification/internal/policy/container/has_license_test.go
+++ b/certification/internal/policy/container/has_license_test.go
@@ -49,7 +49,7 @@ var _ = Describe("HasLicense", func() {
 			})
 			It("Should not pass Validate", func() {
 				ok, err := HasLicense.Validate(imgRef)
-				Expect(err).To(HaveOccurred())
+				Expect(err).ToNot(HaveOccurred())
 				Expect(ok).To(BeFalse())
 			})
 		})
Repository: projectmesa/mesa
Pull request #2400 (2024-10-23 06:41:34)

Pass through model.rgn in agent analogous to model.random
This is a follow up PR from #2352. It adds a new property to Agent: `Agent.rng`. Implementation wise it is identical to `Agent.random.` This PR also explicitly adds tests for both properties.  

github-actions[bot]: Performance benchmarks:

| Model           | Size   | Init time [95% CI]      | Run time [95% CI]       |
|-----------------|--------|-------------------------|-------------------------|
| BoltzmannWealth | small  | 🔵 +1.6% [+0.8%, +2.3%] | 🔵 -0.1% [-0.3%, +0.2%] |
| BoltzmannWealth | large  | 🔵 +0.2% [-0.4%, +0.7%] | 🔵 -0.3% [-0.8%, +0.2%] |
| Schelling       | small  | 🔵 +0.0% [-0.3%, +0.4%] | 🔵 +0.0% [-0.4%, +0.4%] |
| Schelling       | large  | 🔵 +0.1% [-0.3%, +0.6%] | 🔵 +0.8% [-0.3%, +1.9%] |
| WolfSheep       | small  | 🔵 +0.5% [+0.3%, +0.6%] | 🔵 -0.0% [-0.2%, +0.2%] |
| WolfSheep       | large  | 🔵 +1.0% [+0.3%, +1.7%] | 🔵 +0.5% [-0.1%, +1.1%] |
| BoidFlockers    | small  | 🔵 -1.0% [-1.7%, -0.2%] | 🔵 -1.8% [-2.5%, -1.1%] |
| BoidFlockers    | large  | 🔵 -0.2% [-0.5%, +0.2%] | 🔵 -2.0% [-2.6%, -1.4%] |


Patch:
diff --git a/mesa/agent.py b/mesa/agent.py
index 868acf25..6b6c3d2e 100644
--- a/mesa/agent.py
+++ b/mesa/agent.py
@@ -21,6 +21,8 @@ from random import Random
 # mypy
 from typing import TYPE_CHECKING, Any, Literal, overload
 
+import numpy as np
+
 if TYPE_CHECKING:
     # We ensure that these are not imported during runtime to prevent cyclic
     # dependency.
@@ -85,9 +87,14 @@ class Agent:
 
     @property
     def random(self) -> Random:
-        """Return a seeded rng."""
+        """Return a seeded stdlib rng."""
         return self.model.random
 
+    @property
+    def rng(self) -> np.random.Generator:
+        """Return a seeded np.random rng."""
+        return self.model.rng
+
 
 class AgentSet(MutableSet, Sequence):
     """A collection class that represents an ordered set of agents within an agent-based model (ABM).


Test patch:
diff --git a/tests/test_agent.py b/tests/test_agent.py
index f14c755e..70183ca0 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -162,6 +162,14 @@ def test_agent_membership():
     assert AgentTest(model) not in agentset
 
 
+def test_agent_rng():
+    """Test whether agent.random and agent.rng are equal to model.random and model.rng."""
+    model = Model(seed=42)
+    agent = Agent(model)
+    assert agent.random is model.random
+    assert agent.rng is model.rng
+
+
 def test_agent_add_remove_discard():
     """Test adding, removing and discarding agents from AgentSet."""
     model = Model()
Repository: projectmesa/mesa
Pull request #2598 (2025-01-06 07:59:27)

Bugfix for non deterministic rng behavior
This fixes a bug in how the numpy rng is seeded. If instantiating a model with `Model(seed=42)`, rng should default to 42, not `None`. The net result of this bug is that at the moment,  `Model(seed=42) will leave the numpy rgn undeterministic. This adds an explicit test to ensure that both model.random and model.rng behave in a deterministic manner when seeded with the same initial value and fixes the bug. 

github-actions[bot]: Performance benchmarks:

| Model           | Size   | Init time [95% CI]      | Run time [95% CI]          |
|-----------------|--------|-------------------------|----------------------------|
| BoltzmannWealth | small  | 🔵 -3.0% [-5.6%, -0.2%] | 🔵 +1.0% [+0.8%, +1.1%]    |
| BoltzmannWealth | large  | 🔵 +1.2% [+0.6%, +1.7%] | 🔵 +3.1% [+1.9%, +4.3%]    |
| Schelling       | small  | 🔵 -0.2% [-0.5%, +0.2%] | 🔵 +1.0% [+0.9%, +1.1%]    |
| Schelling       | large  | 🔵 +0.7% [+0.3%, +1.0%] | 🔵 -0.6% [-1.6%, +0.2%]    |
| WolfSheep       | small  | 🔵 -0.5% [-1.1%, +0.2%] | 🔴 +22.0% [+16.4%, +27.7%] |
| WolfSheep       | large  | 🔵 -2.0% [-2.7%, -1.5%] | 🔵 -4.0% [-5.4%, -2.5%]    |
| BoidFlockers    | small  | 🔵 +1.8% [+1.3%, +2.3%] | 🔵 +0.2% [-0.5%, +0.9%]    |
| BoidFlockers    | large  | 🔵 +3.3% [+2.3%, +4.3%] | 🔵 +0.5% [+0.1%, +1.0%]    |


Patch:
diff --git a/mesa/model.py b/mesa/model.py
index 8263926a..c507ed73 100644
--- a/mesa/model.py
+++ b/mesa/model.py
@@ -94,7 +94,7 @@ class Model:
             self._seed = seed  # this allows for reproducing stdlib.random
 
             try:
-                self.rng: np.random.Generator = np.random.default_rng(rng)
+                self.rng: np.random.Generator = np.random.default_rng(seed)
             except TypeError:
                 rng = self.random.randint(0, sys.maxsize)
                 self.rng: np.random.Generator = np.random.default_rng(rng)


Test patch:
diff --git a/tests/test_model.py b/tests/test_model.py
index ff1fe297..a7e054d1 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -1,5 +1,7 @@
 """Tests for model.py."""
 
+import numpy as np
+
 from mesa.agent import Agent, AgentSet
 from mesa.model import Model
 
@@ -37,6 +39,16 @@ def test_seed(seed=23):
     assert model2._seed == seed + 1
     assert model._seed == seed
 
+    assert Model(seed=42).random.random() == Model(seed=42).random.random()
+    assert np.all(
+        Model(seed=42).rng.random(
+            10,
+        )
+        == Model(seed=42).rng.random(
+            10,
+        )
+    )
+
 
 def test_reset_randomizer(newseed=42):
     """Test resetting the random seed on the model."""
Repository: projectmesa/mesa
Pull request #345 (2016-12-21 18:52:50)

fix boundaries of ContinousSpace
An IndexOutOfBounds Exception was thrown when an agent was placed at either the x_max or y_max in a ContinuousSpace.  My simple fix was to have the `out_of_bounds` function use a >= comparison instead of >.  I also added some tests of these boundaries in test_space.py



Patch:
diff --git a/mesa/space.py b/mesa/space.py
index 4e96a21b..76833a15 100644
--- a/mesa/space.py
+++ b/mesa/space.py
@@ -592,5 +592,5 @@ class ContinuousSpace:
     def out_of_bounds(self, pos):
         """ Check if a point is out of bounds. """
         x, y = pos
-        return (x < self.x_min or x > self.x_max or
-                y < self.y_min or y > self.y_max)
+        return (x < self.x_min or x >= self.x_max or
+                y < self.y_min or y >= self.y_max)


Test patch:
diff --git a/tests/test_space.py b/tests/test_space.py
index d490e508..55364368 100644
--- a/tests/test_space.py
+++ b/tests/test_space.py
@@ -4,6 +4,7 @@ from mesa.space import ContinuousSpace
 from test_grid import MockAgent
 
 TEST_AGENTS = [(-20, -20), (-20, -20.05), (65, 18)]
+OUTSIDE_POSITIONS = [(70, 10), (30, 20), (100, 10)]
 
 
 class TestSpaceToroidal(unittest.TestCase):
@@ -54,6 +55,25 @@ class TestSpaceToroidal(unittest.TestCase):
         neighbors_3 = self.space.get_neighbors((-30, -30), 10)
         assert len(neighbors_3) == 1
 
+    def test_bounds(self):
+        '''
+        Test positions outside of boundary
+        '''
+        boundary_agents = []
+        for i, pos in enumerate(OUTSIDE_POSITIONS):
+            a = MockAgent(len(self.agents) + i, None)
+            boundary_agents.append(a)
+            self.space.place_agent(a, pos)
+
+        for a, pos in zip(boundary_agents, OUTSIDE_POSITIONS):
+            adj_pos = self.space.torus_adj(pos)
+            assert a.pos == adj_pos
+
+        a = self.agents[0]
+        for pos in OUTSIDE_POSITIONS:
+            assert self.space.out_of_bounds(pos)
+            self.space.move_agent(a, pos)
+
 
 class TestSpaceNonToroidal(unittest.TestCase):
     '''
@@ -100,3 +120,18 @@ class TestSpaceNonToroidal(unittest.TestCase):
 
         neighbors_3 = self.space.get_neighbors((-30, -30), 10)
         assert len(neighbors_3) == 0
+
+    def test_bounds(self):
+        '''
+        Test positions outside of boundary
+        '''
+        for i, pos in enumerate(OUTSIDE_POSITIONS):
+            a = MockAgent(len(self.agents) + i, None)
+            with self.assertRaises(Exception):
+                self.space.place_agent(a, pos)
+
+        a = self.agents[0]
+        for pos in OUTSIDE_POSITIONS:
+            assert self.space.out_of_bounds(pos)
+            with self.assertRaises(Exception):
+                self.space.move_agent(a, pos)
Repository: projectmesa/mesa
Pull request #429 (2017-11-16 16:02:11)

[BUGFIX] Torus adjustment in Grid class
This is a PR in response to #420 

The `torus_adj` method was updated to have a similar signature to the one in `ContinuousGrid`. `move_agent` now does a position check for toroid. 


Patch:
diff --git a/mesa/space.py b/mesa/space.py
index 4cb665f2..7e451fd3 100644
--- a/mesa/space.py
+++ b/mesa/space.py
@@ -162,8 +162,7 @@ class Grid:
                                        not (0 <= dy + y < self.height)):
                     continue
 
-                px = self.torus_adj(x + dx, self.width)
-                py = self.torus_adj(y + dy, self.height)
+                px, py = self.torus_adj((x + dx, y + dy))
 
                 # Skip if new coords out of bounds.
                 if(self.out_of_bounds((px, py))):
@@ -246,11 +245,15 @@ class Grid:
         return list(self.iter_neighbors(
             pos, moore, include_center, radius))
 
-    def torus_adj(self, coord, dim_len):
+    def torus_adj(self, pos):
         """ Convert coordinate, handling torus looping. """
-        if self.torus:
-            coord %= dim_len
-        return coord
+        if not self.out_of_bounds(pos):
+            return pos
+        elif not self.torus:
+            raise Exception("Point out of bounds, and space non-toroidal.")
+        else:
+            x, y = pos[0] % self.width, pos[1] % self.height
+        return x, y
 
     def out_of_bounds(self, pos):
         """
@@ -295,6 +298,7 @@ class Grid:
             pos: Tuple of new position to move the agent to.
 
         """
+        pos = self.torus_adj(pos)
         self._remove_agent(agent.pos, agent)
         self._place_agent(pos, agent)
         agent.pos = pos


Test patch:
diff --git a/tests/test_grid.py b/tests/test_grid.py
index e2fd7f27..987d100c 100644
--- a/tests/test_grid.py
+++ b/tests/test_grid.py
@@ -147,6 +147,30 @@ class TestBaseGrid(unittest.TestCase):
         assert second[1] == 0
         assert second[2] == 1
 
+    def test_agent_move(self):
+        # get the agent at [0, 1]
+        agent = self.agents[0]
+        self.grid.move_agent(agent, (1, 1))
+        assert agent.pos == (1, 1)
+        # move it off the torus and check for the exception
+        if not self.torus:
+            with self.assertRaises(Exception):
+                self.grid.move_agent(agent, [-1, 1])
+            with self.assertRaises(Exception):
+                self.grid.move_agent(agent, [1, self.grid.height + 1])
+        else:
+            self.grid.move_agent(agent, [-1, 1])
+            assert agent.pos == (self.grid.width - 1, 1)
+            self.grid.move_agent(agent, [1, self.grid.height + 1])
+            assert agent.pos == (1, 1)
+
+    def test_agent_remove(self):
+        agent = self.agents[0]
+        x, y = agent.pos
+        self.grid.remove_agent(agent)
+        assert agent.pos is None
+        assert self.grid.grid[x][y] is None
+
 
 class TestBaseGridTorus(TestBaseGrid):
     '''
Repository: projectmesa/mesa
Pull request #556 (2018-07-08 12:19:49)

updated BatchRunner
Program throwing error when passing in agent reporters. Error at line 185
line 185: agent_record[vars] = reporter(agent)    *error* could not read string
updated line 185 to
line 185:  agent[vars]=getattr(agent, reporter)

program ran without error, produced appropriate results from datacollector/batchrunner



Patch:
diff --git a/mesa/batchrunner.py b/mesa/batchrunner.py
index f900f9af..311fc1f6 100644
--- a/mesa/batchrunner.py
+++ b/mesa/batchrunner.py
@@ -182,7 +182,7 @@ class BatchRunner:
         for agent in model.schedule._agents.values():
             agent_record = {}
             for var, reporter in self.agent_reporters.items():
-                agent_record[var] = reporter(agent)
+                agent_record[var] = getattr(agent, reporter)
             agent_vars[agent.unique_id] = agent_record
         return agent_vars
 


Test patch:
diff --git a/tests/test_batchrunner.py b/tests/test_batchrunner.py
index 7a3acb84..21befb9e 100644
--- a/tests/test_batchrunner.py
+++ b/tests/test_batchrunner.py
@@ -74,8 +74,8 @@ class TestBatchRunner(unittest.TestCase):
             "reported_fixed_value": lambda m: m.fixed_model_param
         }
         self.agent_reporters = {
-            "agent_id": lambda a: a.unique_id,
-            "agent_val": lambda a: a.val
+            "agent_id": "unique_id",
+            "agent_val": "val"
         }
         self.variable_params = {
             "variable_model_param": range(3),
@@ -162,5 +162,6 @@ class TestBatchRunner(unittest.TestCase):
         self.assertEqual(model_vars['reported_fixed_param'].iloc[0],
                 self.fixed_params['fixed_name'])
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/test_datacollector.py b/tests/test_datacollector.py
index 6363fa16..6d572115 100644
--- a/tests/test_datacollector.py
+++ b/tests/test_datacollector.py
@@ -129,5 +129,6 @@ class TestDataCollector(unittest.TestCase):
         with self.assertRaises(Exception):
             table_df = data_collector.get_table_dataframe("not a real table")
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/test_grid.py b/tests/test_grid.py
index b3218a2f..25c6912a 100644
--- a/tests/test_grid.py
+++ b/tests/test_grid.py
@@ -438,5 +438,6 @@ class TestHexGridTorus(TestBaseGrid):
         neighborhood = self.grid.get_neighborhood((2, 4))
         assert len(neighborhood) == 6
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/test_space.py b/tests/test_space.py
index ea81d2d9..6af7058c 100644
--- a/tests/test_space.py
+++ b/tests/test_space.py
@@ -412,5 +412,6 @@ class TestMultipleNetworkGrid(unittest.TestCase):
                                                       self.agents[1],
                                                       self.agents[2]]
 
+
 if __name__ == '__main__':
     unittest.main()
Repository: projectmesa/mesa
Pull request #920 (2020-09-12 17:39:43)

Fix for #919, adding exception for duplicate ids


Patch:
diff --git a/mesa/time.py b/mesa/time.py
index 809c152f..7f808bdc 100644
--- a/mesa/time.py
+++ b/mesa/time.py
@@ -60,6 +60,10 @@ class BaseScheduler:
             have a step() method.
 
         """
+
+        if agent.unique_id in self._agents:
+            raise Exception("Agent with unique id {0} already added to scheduler".format(repr(agent.unique_id)))
+
         self._agents[agent.unique_id] = agent
 
     def remove(self, agent: Agent) -> None:


Test patch:
diff --git a/tests/test_time.py b/tests/test_time.py
index 99ef81b3..faf61571 100644
--- a/tests/test_time.py
+++ b/tests/test_time.py
@@ -122,6 +122,12 @@ class TestStagedActivation(TestCase):
         model.schedule.remove(agent)
         assert agent not in model.schedule.agents
 
+    def test_add_existing_agent(self):
+        model = MockModel()
+        agent = model.schedule.agents[0]
+        with self.assertRaises(Exception):
+            model.schedule.add(agent)
+
 
 class TestRandomActivation(TestCase):
     """
Repository: projectmesa/mesa
Pull request #1289 (2022-04-22 13:00:42)

batch_run: Do not iterate values when it is a single string
This addresses one of the concern in #1280.

Corvince: I originally did not include this check, because I wanted to preserve the use case of actually using strings as iterables. But this is still possible as `['s', 't', 'r', 'i', 'n', 'g']` and is probably seldom needed, whereas the current required workaround of `['string']` for strings as constants leads to more confusion.

so :+1: for this PR

Patch:
diff --git a/mesa/batchrunner.py b/mesa/batchrunner.py
index 0556a38f..b4290f28 100644
--- a/mesa/batchrunner.py
+++ b/mesa/batchrunner.py
@@ -128,10 +128,14 @@ def _make_model_kwargs(
     """
     parameter_list = []
     for param, values in parameters.items():
-        try:
-            all_values = [(param, value) for value in values]
-        except TypeError:
+        if isinstance(values, str):
+            # The values is a single string, so we shouldn't iterate over it.
             all_values = [(param, values)]
+        else:
+            try:
+                all_values = [(param, value) for value in values]
+            except TypeError:
+                all_values = [(param, values)]
         parameter_list.append(all_values)
     all_kwargs = itertools.product(*parameter_list)
     kwargs_list = [dict(kwargs) for kwargs in all_kwargs]


Test patch:
diff --git a/tests/test_batch_run.py b/tests/test_batch_run.py
index 072b1dae..67ce3bc9 100644
--- a/tests/test_batch_run.py
+++ b/tests/test_batch_run.py
@@ -18,6 +18,8 @@ def test_make_model_kwargs():
         {"a": 1, "b": 0},
         {"a": 1, "b": 1},
     ]
+    # If the value is a single string, do not iterate over it.
+    assert _make_model_kwargs({"a": "value"}) == [{"a": "value"}]
 
 
 class MockAgent(Agent):
Repository: prometheus/client_python
Pull request #6 (2015-02-22 18:25:30)

Disallow 'quantile' as a label to Summary.


Patch:
diff --git a/prometheus_client/__init__.py b/prometheus_client/__init__.py
index 8a87285..aa44616 100644
--- a/prometheus_client/__init__.py
+++ b/prometheus_client/__init__.py
@@ -136,6 +136,8 @@ def _MetricWrapper(cls):
           raise ValueError('Invalid label metric name: ' + l)
         if _RESERVED_METRIC_LABEL_NAME_RE.match(l):
           raise ValueError('Reserved label metric name: ' + l)
+        if l in cls._reserved_labelnames:
+          raise ValueError('Reserved label metric name: ' + l)
       collector = _LabelWrapper(cls, labelnames)
     else:
       collector = cls()
@@ -165,6 +167,7 @@ def _MetricWrapper(cls):
 @_MetricWrapper
 class Counter(object):
   _type = 'counter'
+  _reserved_labelnames = []
   def __init__(self):
     self._value = 0.0
     self._lock = Lock()
@@ -205,6 +208,7 @@ class Counter(object):
 @_MetricWrapper
 class Gauge(object):
   _type = 'gauge'
+  _reserved_labelnames = []
   def __init__(self):
     self._value = 0.0
     self._lock = Lock()
@@ -257,6 +261,7 @@ class Gauge(object):
 @_MetricWrapper
 class Summary(object):
   _type = 'summary'
+  _reserved_labelnames = ['quantile']
   def __init__(self):
     self._count = 0.0
     self._sum = 0.0


Test patch:
diff --git a/tests/test_client.py b/tests/test_client.py
index 9bf82ed..837258a 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -143,6 +143,7 @@ class TestMetricWrapper(unittest.TestCase):
     self.assertRaises(ValueError, Counter, '', 'help', subsystem='(')
     self.assertRaises(ValueError, Counter, 'c', '', labelnames=['^'])
     self.assertRaises(ValueError, Counter, 'c', '', labelnames=['__reserved'])
+    self.assertRaises(ValueError, Summary, 'c', '', labelnames=['quantile'])
 
 class TestGenerateText(unittest.TestCase):
   def setUp(self):