Skip to content

Commit aa3b4de

Browse files
tests: don't always test the mocks
The mock file is pretty big, and due to that has a lot of tests The mocks should not need to be edited often, only when the dependency they are mocking is updated. This is currently never, as it is unmaintained. This means that we don't need to run the tests for the mocks all the time. If an upgrade of our dependencies is taken, then the test file should be ran. However, it does not need to run every time the test suite is ran. This should lead to a faster total test suite when running the suite.
1 parent 6f92e86 commit aa3b4de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ build-backend = "poetry.core.masonry.api"
6363

6464
[tool.coverage.run]
6565
branch = true
66-
source_pkgs = ['modmail', 'tests']
66+
source_pkgs = ['modmail', 'tests.modmail']
6767
omit = ["modmail/plugins/**.*"]
6868

6969
[tool.pytest.ini_options]
7070
addopts = "--cov --cov-report="
7171
minversion = "6.0"
72-
testpaths = ["tests"]
72+
testpaths = ["tests/modmail"]
7373

7474
[tool.black]
7575
line-length = 110
@@ -89,3 +89,4 @@ lint = { cmd = "pre-commit run --all-files", help = "Checks all files for CI err
8989
precommit = { cmd = "pre-commit install --install-hooks", help = "Installs the precommit hook" }
9090
report = { cmd = "coverage report", help = "Show coverage report from previously run tests." }
9191
test = { cmd = "pytest -n auto --dist loadfile", help = "Runs tests and save results to a coverage report" }
92+
test_mocks = { cmd = 'pytest tests/test_mocks.py', help = 'Runs the tests on the mock files. They are excluded from the main test suite.' }

0 commit comments

Comments
 (0)