tests: refactor to pytest (conftest session fixture, sync wrappers for async, importorskip for playwright)

This commit is contained in:
jozamudi committed 2026-08-19 18:59:48 +00:00
1 parent bb1297f8e2
commit 29fab7ff5f
5 files changed
+130 -135

No files matched your search

+4 -13
View File
@@ -1,8 +1,8 @@
"""HTTP-level tests for ani-web (stdlib only). Run via tests/run.py or
standalone against a running server: python tests/test_api.py <base_url>
"""HTTP-level tests for ani-web (stdlib only), run via pytest.
Uses a throwaway server + temp data dir (see run.py) — never touches
the real server/data. Seeded users: admin/alice/bob (pw <name>pw12345).
Uses the throwaway server + temp data dir from conftest.py — never
touches the real server/data. Seeded users: admin/alice/bob/dave/erin
(pw <name>pw12345).
"""
import http.cookiejar as _cj
import json
@@ -187,12 +187,3 @@ def _json(method, path, jar=None, base=BASE):
def _users_file():
import os
return os.path.join(os.environ["ANIWEB_DATA"], "users.json")
if __name__ == "__main__":
import sys
b = sys.argv[1] if len(sys.argv) > 1 else BASE
for name, fn in sorted(globals().items()):
if name.startswith("test_"):
print("ok", name)
fn(b)