summaryrefslogtreecommitdiffhomepage
path: root/tasks.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2023-05-04 14:46:23 -0400
committerJeff Forcier <jeff@bitprophet.org>2023-05-18 13:57:13 -0400
commita39ddd1a9cb4b4c5afa80e0fbc05ed678708f2ce (patch)
tree3968bd8beadb58edf624a141b51db7b44f05cce3 /tasks.py
parente22c5ea330814801d8487dc3da347f987bafe5ec (diff)
Modernize auth tests to use shared server manager
Also move auth tests to be new style filename, obj naming Also allow test task module selector to see new-style test modules
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tasks.py b/tasks.py
index 1f5e999c..f58f699e 100644
--- a/tasks.py
+++ b/tasks.py
@@ -1,4 +1,5 @@
import os
+from pathlib import Path
from os.path import join
from shutil import rmtree, copytree
@@ -50,8 +51,10 @@ def test(
opts += " -f"
modstr = ""
if module is not None:
- # NOTE: implicit test_ prefix as we're not on pytest-relaxed yet
- modstr = " tests/test_{}.py".format(module)
+ base = f"{module}.py"
+ tests = Path("tests")
+ legacy = tests / f"test_{base}"
+ modstr = str(legacy if legacy.exists() else tests / base)
# Switch runner depending on coverage or no coverage.
# TODO: get pytest's coverage plugin working, IIRC it has issues?
runner = "pytest"