From 276a9b734a3d95c4e1d07f7dcac63fea5ab24a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Thu, 12 Dec 2024 17:37:00 +0100 Subject: [PATCH] Speed up tests --- .vscode/settings.json | 3 +++ pyproject.toml | 4 ++++ {core/tests => tests}/__init__.py | 0 {core/tests => tests}/conftest.py | 0 {core/tests => tests}/response.json | 0 {core/tests => tests}/view_test.py | 0 6 files changed, 7 insertions(+) rename {core/tests => tests}/__init__.py (100%) rename {core/tests => tests}/conftest.py (100%) rename {core/tests => tests}/response.json (100%) rename {core/tests => tests}/view_test.py (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6725c98..ac6d774 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "appauthor", "appendonly", "appname", + "asctime", "asgiref", "autouse", "Behaviour", @@ -24,6 +25,7 @@ "Hellsén", "isort", "Joakim", + "levelname", "logdir", "Lovinator", "lvthalo", @@ -52,6 +54,7 @@ "stylesheet", "tabindex", "templatetags", + "testpaths", "timebaseddrop", "timesince", "timeuntil", diff --git a/pyproject.toml b/pyproject.toml index 7e10f49..083d727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,10 @@ log_cli_level = "INFO" log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)" log_cli_date_format = "%Y-%m-%d %H:%M:%S" +# Only check /tests/ directory for tests. +# This will speed up the test run significantly. (5.16s -> 0.25s) +testpaths = ["tests"] + [tool.mypy] plugins = ["mypy_django_plugin.main"] diff --git a/core/tests/__init__.py b/tests/__init__.py similarity index 100% rename from core/tests/__init__.py rename to tests/__init__.py diff --git a/core/tests/conftest.py b/tests/conftest.py similarity index 100% rename from core/tests/conftest.py rename to tests/conftest.py diff --git a/core/tests/response.json b/tests/response.json similarity index 100% rename from core/tests/response.json rename to tests/response.json diff --git a/core/tests/view_test.py b/tests/view_test.py similarity index 100% rename from core/tests/view_test.py rename to tests/view_test.py