Skip to content

Commit

Permalink
tests: Don't try to collect tests from Agent helper classes
Browse files Browse the repository at this point in the history
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):
  • Loading branch information
EwoutH committed Sep 26, 2024
1 parent b37fc45 commit a136ef7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand All @@ -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."""

Expand Down

0 comments on commit a136ef7

Please sign in to comment.