From a136ef7dbe2d1accb5ab003d7fbeb65673628ae4 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Thu, 26 Sep 2024 10:15:37 +0200 Subject: [PATCH] tests: Don't try to collect tests from Agent helper classes resolves: tests/test_agent.py:12 /home/runner/work/mesa/mesa/tests/test_agent.py:12: PytestCollectionWarning: cannot collect test class 'TestAgent' because it has a __init__ constructor (from: tests/test_agent.py) class TestAgent(Agent): tests/test_agent.py:20 /home/runner/work/mesa/mesa/tests/test_agent.py:20: PytestCollectionWarning: cannot collect test class 'TestAgentDo' because it has a __init__ constructor (from: tests/test_agent.py) class TestAgentDo(Agent): --- tests/test_agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_agent.py b/tests/test_agent.py index 3352717f410..226164ac09d 100644 --- a/tests/test_agent.py +++ b/tests/test_agent.py @@ -9,6 +9,7 @@ from mesa.model import Model +@pytest.mark.skip(reason="Helper class, not a test class") class TestAgent(Agent): """Agent class for testing.""" @@ -17,6 +18,7 @@ def get_unique_identifier(self): return self.unique_id +@pytest.mark.skip(reason="Helper class, not a test class") class TestAgentDo(Agent): """Agent class for testing."""