From 59efe51f9d8344d779ca33710aaae90cb90e15e9 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Tue, 12 Dec 2023 15:09:36 +0100 Subject: [PATCH] fixing async tests --- backend/Pipfile | 2 +- backend/Pipfile.lock | 188 +++++++++----------- backend/tests/api/api_v1/test_acmgseqvar.py | 70 ++++---- backend/tests/api/api_v1/test_adminmsgs.py | 2 +- backend/tests/api/api_v1/test_bookmarks.py | 56 +++--- backend/tests/api/api_v1/test_caseinfo.py | 74 ++++---- backend/tests/api/api_v1/test_utils.py | 6 +- backend/tests/api/internal/test_proxy.py | 14 +- backend/tests/api/internal/test_remote.py | 6 +- backend/tests/conftest.py | 8 +- backend/tests/crud/test_acmgseqvar.py | 8 +- backend/tests/crud/test_adminmsg.py | 6 +- backend/tests/crud/test_bookmark.py | 8 +- backend/tests/crud/test_caseinfo.py | 8 +- backend/tests/test_main.py | 10 +- 15 files changed, 223 insertions(+), 243 deletions(-) diff --git a/backend/Pipfile b/backend/Pipfile index bffc07ec..d772f0df 100644 --- a/backend/Pipfile +++ b/backend/Pipfile @@ -39,8 +39,8 @@ isort = "*" mypy = "*" pip = "*" pytest = "*" -pytest-asyncio = "*" pytest-cov = "*" +pytest-anyio = "*" pytest-faker = "*" pytest-httpx = "*" pytest-subprocess = "*" diff --git a/backend/Pipfile.lock b/backend/Pipfile.lock index 62a19c39..37280257 100644 --- a/backend/Pipfile.lock +++ b/backend/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7c48cfa92f809b2a73ce6896b0b2681e0b776ce9e9556f5f9a6c06741770a508" + "sha256": "82c9f60fbb9c742b7e279a478690d993dabe299b1956bf3b8134e4a0d189f06b" }, "pipfile-spec": 6, "requires": { @@ -18,12 +18,12 @@ "default": { "alembic": { "hashes": [ - "sha256:47d52e3dfb03666ed945becb723d6482e52190917fdb47071440cfdba05d92cb", - "sha256:bca5877e9678b454706347bc10b97cb7d67f300320fa5c3a94423e8266e2823f" + "sha256:a23974ea301c3ee52705db809c7413cecd165290c6679b9998dd6c74342ca23a", + "sha256:ab4b3b94d2e1e5f81e34be8a9b7b7575fc9dd5398fccb0bef351ec9b14872623" ], "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==1.12.1" + "markers": "python_version >= '3.8'", + "version": "==1.13.0" }, "annotated-types": { "hashes": [ @@ -383,12 +383,12 @@ }, "fastapi": { "hashes": [ - "sha256:752dc31160cdbd0436bb93bad51560b57e525cbb1d4bbf6f4904ceee75548241", - "sha256:e5e4540a7c5e1dcfbbcf5b903c234feddcdcd881f191977a1c5dfd917487e7ae" + "sha256:4d12838819aa52af244580675825e750ad67c9df4614f557a769606af902cf22", + "sha256:f19ebf6fdc82a3281d10f2cb4774bdfa90238e3b40af3525a0c09fd08ad1c480" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==0.104.1" + "version": "==0.105.0" }, "fastapi-users": { "extras": [ @@ -412,67 +412,68 @@ }, "greenlet": { "hashes": [ - "sha256:0a02d259510b3630f330c86557331a3b0e0c79dac3d166e449a39363beaae174", - "sha256:0b6f9f8ca7093fd4433472fd99b5650f8a26dcd8ba410e14094c1e44cd3ceddd", - "sha256:100f78a29707ca1525ea47388cec8a049405147719f47ebf3895e7509c6446aa", - "sha256:1757936efea16e3f03db20efd0cd50a1c86b06734f9f7338a90c4ba85ec2ad5a", - "sha256:19075157a10055759066854a973b3d1325d964d498a805bb68a1f9af4aaef8ec", - "sha256:19bbdf1cce0346ef7341705d71e2ecf6f41a35c311137f29b8a2dc2341374565", - "sha256:20107edf7c2c3644c67c12205dc60b1bb11d26b2610b276f97d666110d1b511d", - "sha256:22f79120a24aeeae2b4471c711dcf4f8c736a2bb2fabad2a67ac9a55ea72523c", - "sha256:2847e5d7beedb8d614186962c3d774d40d3374d580d2cbdab7f184580a39d234", - "sha256:28e89e232c7593d33cac35425b58950789962011cc274aa43ef8865f2e11f46d", - "sha256:329c5a2e5a0ee942f2992c5e3ff40be03e75f745f48847f118a3cfece7a28546", - "sha256:337322096d92808f76ad26061a8f5fccb22b0809bea39212cd6c406f6a7060d2", - "sha256:3fcc780ae8edbb1d050d920ab44790201f027d59fdbd21362340a85c79066a74", - "sha256:41bdeeb552d814bcd7fb52172b304898a35818107cc8778b5101423c9017b3de", - "sha256:4eddd98afc726f8aee1948858aed9e6feeb1758889dfd869072d4465973f6bfd", - "sha256:52e93b28db27ae7d208748f45d2db8a7b6a380e0d703f099c949d0f0d80b70e9", - "sha256:55d62807f1c5a1682075c62436702aaba941daa316e9161e4b6ccebbbf38bda3", - "sha256:5805e71e5b570d490938d55552f5a9e10f477c19400c38bf1d5190d760691846", - "sha256:599daf06ea59bfedbec564b1692b0166a0045f32b6f0933b0dd4df59a854caf2", - "sha256:60d5772e8195f4e9ebf74046a9121bbb90090f6550f81d8956a05387ba139353", - "sha256:696d8e7d82398e810f2b3622b24e87906763b6ebfd90e361e88eb85b0e554dc8", - "sha256:6e6061bf1e9565c29002e3c601cf68569c450be7fc3f7336671af7ddb4657166", - "sha256:80ac992f25d10aaebe1ee15df45ca0d7571d0f70b645c08ec68733fb7a020206", - "sha256:816bd9488a94cba78d93e1abb58000e8266fa9cc2aa9ccdd6eb0696acb24005b", - "sha256:85d2b77e7c9382f004b41d9c72c85537fac834fb141b0296942d52bf03fe4a3d", - "sha256:87c8ceb0cf8a5a51b8008b643844b7f4a8264a2c13fcbcd8a8316161725383fe", - "sha256:89ee2e967bd7ff85d84a2de09df10e021c9b38c7d91dead95b406ed6350c6997", - "sha256:8bef097455dea90ffe855286926ae02d8faa335ed8e4067326257cb571fc1445", - "sha256:8d11ebbd679e927593978aa44c10fc2092bc454b7d13fdc958d3e9d508aba7d0", - "sha256:91e6c7db42638dc45cf2e13c73be16bf83179f7859b07cfc139518941320be96", - "sha256:97e7ac860d64e2dcba5c5944cfc8fa9ea185cd84061c623536154d5a89237884", - "sha256:990066bff27c4fcf3b69382b86f4c99b3652bab2a7e685d968cd4d0cfc6f67c6", - "sha256:9fbc5b8f3dfe24784cee8ce0be3da2d8a79e46a276593db6868382d9c50d97b1", - "sha256:ac4a39d1abae48184d420aa8e5e63efd1b75c8444dd95daa3e03f6c6310e9619", - "sha256:b2c02d2ad98116e914d4f3155ffc905fd0c025d901ead3f6ed07385e19122c94", - "sha256:b2d3337dcfaa99698aa2377c81c9ca72fcd89c07e7eb62ece3f23a3fe89b2ce4", - "sha256:b489c36d1327868d207002391f662a1d163bdc8daf10ab2e5f6e41b9b96de3b1", - "sha256:b641161c302efbb860ae6b081f406839a8b7d5573f20a455539823802c655f63", - "sha256:b8ba29306c5de7717b5761b9ea74f9c72b9e2b834e24aa984da99cbfc70157fd", - "sha256:b9934adbd0f6e476f0ecff3c94626529f344f57b38c9a541f87098710b18af0a", - "sha256:ce85c43ae54845272f6f9cd8320d034d7a946e9773c693b27d620edec825e376", - "sha256:cf868e08690cb89360eebc73ba4be7fb461cfbc6168dd88e2fbbe6f31812cd57", - "sha256:d2905ce1df400360463c772b55d8e2518d0e488a87cdea13dd2c71dcb2a1fa16", - "sha256:d57e20ba591727da0c230ab2c3f200ac9d6d333860d85348816e1dca4cc4792e", - "sha256:d6a8c9d4f8692917a3dc7eb25a6fb337bff86909febe2f793ec1928cd97bedfc", - "sha256:d923ff276f1c1f9680d32832f8d6c040fe9306cbfb5d161b0911e9634be9ef0a", - "sha256:daa7197b43c707462f06d2c693ffdbb5991cbb8b80b5b984007de431493a319c", - "sha256:dbd4c177afb8a8d9ba348d925b0b67246147af806f0b104af4d24f144d461cd5", - "sha256:dc4d815b794fd8868c4d67602692c21bf5293a75e4b607bb92a11e821e2b859a", - "sha256:e9d21aaa84557d64209af04ff48e0ad5e28c5cca67ce43444e939579d085da72", - "sha256:ea6b8aa9e08eea388c5f7a276fabb1d4b6b9d6e4ceb12cc477c3d352001768a9", - "sha256:eabe7090db68c981fca689299c2d116400b553f4b713266b130cfc9e2aa9c5a9", - "sha256:f2f6d303f3dee132b322a14cd8765287b8f86cdc10d2cb6a6fae234ea488888e", - "sha256:f33f3258aae89da191c6ebaa3bc517c6c4cbc9b9f689e5d8452f7aedbb913fa8", - "sha256:f7bfb769f7efa0eefcd039dd19d843a4fbfbac52f1878b1da2ed5793ec9b1a65", - "sha256:f89e21afe925fcfa655965ca8ea10f24773a1791400989ff32f467badfe4a064", - "sha256:fa24255ae3c0ab67e613556375a4341af04a084bd58764731972bcbc8baeba36" + "sha256:006c1028ac0cfcc4e772980cfe73f5476041c8c91d15d64f52482fc571149d46", + "sha256:0acadbc3f72cb0ee85070e8d36bd2a4673d2abd10731ee73c10222cf2dd4713c", + "sha256:0c0fdb8142742ee68e97c106eb81e7d3e883cc739d9c5f2b28bc38a7bafeb6d1", + "sha256:0df7eed98ea23b20e9db64d46eb05671ba33147df9405330695bcd81a73bb0c9", + "sha256:10d247260db20887ae8857c0cbc750b9170f0b067dd7d38fb68a3f2334393bd3", + "sha256:14b5d999aefe9ffd2049ad19079f733c3aaa426190ffecadb1d5feacef8fe397", + "sha256:18fe39d70d482b22f0014e84947c5aaa7211fb8e13dc4cc1c43ed2aa1db06d9a", + "sha256:1c1129bc47266d83444c85a8e990ae22688cf05fb20d7951fd2866007c2ba9bc", + "sha256:1dac09e3c0b78265d2e6d3cbac2d7c48bd1aa4b04a8ffeda3adde9f1688df2c3", + "sha256:2c93cd03acb1499ee4de675e1a4ed8eaaa7227f7949dc55b37182047b006a7aa", + "sha256:2e9c5423046eec21f6651268cb674dfba97280701e04ef23d312776377313206", + "sha256:2ee59c4627c8c4bb3e15949fbcd499abd6b7f4ad9e0bfcb62c65c5e2cabe0ec4", + "sha256:339c0272a62fac7e602e4e6ec32a64ff9abadc638b72f17f6713556ed011d493", + "sha256:38878744926cec29b5cc3654ef47f3003f14bfbba7230e3c8492393fe29cc28b", + "sha256:3e4bfa752b3688d74ab1186e2159779ff4867644d2b1ebf16db14281f0445377", + "sha256:520fcb53a39ef90f5021c77606952dbbc1da75d77114d69b8d7bded4a8e1a813", + "sha256:5f9ea7c2c9795549653b6f7569f6bc75d2c7d1f6b2854eb8ce0bc6ec3cb2dd88", + "sha256:654b84c9527182036747938b81938f1d03fb8321377510bc1854a9370418ab66", + "sha256:6d65bec56a7bc352bcf11b275b838df618651109074d455a772d3afe25390b7d", + "sha256:7363756cc439a503505b67983237d1cc19139b66488263eb19f5719a32597836", + "sha256:80d068e4b6e2499847d916ef64176811ead6bf210a610859220d537d935ec6fd", + "sha256:8756a94ed8f293450b0e91119eca2a36332deba69feb2f9ca410d35e74eae1e4", + "sha256:89a6f6ddcbef4000cda7e205c4c20d319488ff03db961d72d4e73519d2465309", + "sha256:8f34a765c5170c0673eb747213a0275ecc749ab3652bdbec324621ed5b2edaef", + "sha256:8f8d14a0a4e8c670fbce633d8b9a1ee175673a695475acd838e372966845f764", + "sha256:950e21562818f9c771989b5b65f990e76f4ac27af66e1bb34634ae67886ede2a", + "sha256:9560c580c896030ff9c311c603aaf2282234643c90d1dec738a1d93e3e53cd51", + "sha256:9acd8fd67c248b8537953cb3af8787c18a87c33d4dcf6830e410ee1f95a63fd4", + "sha256:a37ae53cca36823597fd5f65341b6f7bac2dd69ecd6ca01334bb795460ab150b", + "sha256:aecea0442975741e7d69daff9b13c83caff8c13eeb17485afa65f6360a045765", + "sha256:b1405614692ac986490d10d3e1a05e9734f473750d4bee3cf7d1286ef7af7da6", + "sha256:b1fd25dfc5879a82103b3d9e43fa952e3026c221996ff4d32a9c72052544835d", + "sha256:b2cedf279ca38ef3f4ed0d013a6a84a7fc3d9495a716b84a5fc5ff448965f251", + "sha256:b3f0497db77cfd034f829678b28267eeeeaf2fc21b3f5041600f7617139e6773", + "sha256:bfcecc984d60b20ffe30173b03bfe9ba6cb671b0be1e95c3e2056d4fe7006590", + "sha256:c1f647fe5b94b51488b314c82fdda10a8756d650cee8d3cd29f657c6031bdf73", + "sha256:c235131bf59d2546bb3ebaa8d436126267392f2e51b85ff45ac60f3a26549af0", + "sha256:c27b142a9080bdd5869a2fa7ebf407b3c0b24bd812db925de90e9afe3c417fd6", + "sha256:c42bb589e6e9f9d8bdd79f02f044dff020d30c1afa6e84c0b56d1ce8a324553c", + "sha256:cd5bc4fde0842ff2b9cf33382ad0b4db91c2582db836793d58d174c569637144", + "sha256:cecfdc950dd25f25d6582952e58521bca749cf3eeb7a9bad69237024308c8196", + "sha256:d1fceb5351ab1601903e714c3028b37f6ea722be6873f46e349a960156c05650", + "sha256:d4d0df07a38e41a10dfb62c6fc75ede196572b580f48ee49b9282c65639f3965", + "sha256:d5547b462b8099b84746461e882a3eb8a6e3f80be46cb6afb8524eeb191d1a30", + "sha256:d64643317e76b4b41fdba659e7eca29634e5739b8bc394eda3a9127f697ed4b0", + "sha256:db4233358d3438369051a2f290f1311a360d25c49f255a6c5d10b5bcb3aa2b49", + "sha256:e0e28f5233d64c693382f66d47c362b72089ebf8ac77df7e12ac705c9fa1163d", + "sha256:e79fb5a9fb2d0bd3b6573784f5e5adabc0b0566ad3180a028af99523ce8f6138", + "sha256:e84bef3cfb6b6bfe258c98c519811c240dbc5b33a523a14933a252e486797c90", + "sha256:ed1a8a08de7f68506a38f9a2ddb26bbd1480689e66d788fcd4b5f77e2d9ecfcc", + "sha256:ed9bf77b41798e8417657245b9f3649314218a4a17aefb02bb3992862df32495", + "sha256:edf7a1daba1f7c54326291a8cde58da86ab115b78c91d502be8744f0aa8e3ffa", + "sha256:f260e6c2337871a52161824058923df2bbddb38bc11a5cbe71f3474d877c5bd9", + "sha256:f27aa32466993c92d326df982c4acccd9530fe354e938d9e9deada563e71ce76", + "sha256:f4cf532bf3c58a862196b06947b1b5cc55503884f9b63bf18582a75228d9950e", + "sha256:fb5d60805057d8948065338be6320d35e26b0a72f45db392eb32b70dd6dc9227", + "sha256:fc14dd9554f88c9c1fe04771589ae24db76cd56c8f1104e4381b383d6b71aff8", + "sha256:fefd5eb2c0b1adffdf2802ff7df45bfe65988b15f6b972706a0e55d451bffaea" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==3.0.1" + "version": "==3.0.2" }, "h11": { "hashes": [ @@ -1128,18 +1129,18 @@ }, "typing-extensions": { "hashes": [ - "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", - "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" + "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783", + "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd" ], "markers": "python_version >= '3.8'", - "version": "==4.8.0" + "version": "==4.9.0" }, "urllib3": { "hashes": [ "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54" ], - "markers": "python_version >= '3.6'", + "markers": "python_version >= '3.8'", "version": "==2.1.0" }, "uvicorn": { @@ -1285,11 +1286,11 @@ }, "babel": { "hashes": [ - "sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900", - "sha256:7077a4984b02b6727ac10f1f7294484f737443d7e2e66c5e4380e41a3ae0b4ed" + "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363", + "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287" ], "markers": "python_version >= '3.7'", - "version": "==2.13.1" + "version": "==2.14.0" }, "beautifulsoup4": { "hashes": [ @@ -1996,14 +1997,13 @@ "markers": "python_version >= '3.7'", "version": "==7.4.3" }, - "pytest-asyncio": { + "pytest-anyio": { "hashes": [ - "sha256:c16052382554c7b22d48782ab3438d5b10f8cf7a4bdcae7f0f67f097d95beecc", - "sha256:ea9021364e32d58f0be43b91c6233fb8d2224ccef2398d6837559e587682808f" + "sha256:b41234e9e9ad7ea1dbfefcc1d6891b23d5ef7c9f07ccf804c13a9cc338571fd3", + "sha256:dc8b5c4741cb16ff90be37fddd585ca943ed12bbeb563de7ace6cd94441d8746" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==0.23.2" + "version": "==0.0.0" }, "pytest-cov": { "hashes": [ @@ -2170,22 +2170,6 @@ "markers": "python_version >= '3.7'", "version": "==1.0.0b2" }, - "sphinx-rtd-theme": { - "hashes": [ - "sha256:bd5d7b80622406762073a04ef8fadc5f9151261563d47027de09910ce03afe6b", - "sha256:ec93d0856dc280cf3aee9a4c9807c60e027c7f7b461b77aeffed682e68f0e586" - ], - "index": "pypi", - "markers": "python_version >= '3.6'", - "version": "==2.0.0" - }, - "sphinx-serve": { - "hashes": [ - "sha256:8d90f6595114108500b1f935d3f4d07bf5192783c67ce83f944ef289099669c9" - ], - "index": "pypi", - "version": "==1.0.1" - }, "sphinxcontrib-applehelp": { "hashes": [ "sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d", @@ -2219,14 +2203,6 @@ "markers": "python_version >= '3.9'", "version": "==2.0.4" }, - "sphinxcontrib-jquery": { - "hashes": [ - "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a", - "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae" - ], - "markers": "python_version >= '2.7'", - "version": "==4.1" - }, "sphinxcontrib-jsmath": { "hashes": [ "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", @@ -2294,18 +2270,18 @@ }, "typing-extensions": { "hashes": [ - "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", - "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" + "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783", + "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd" ], "markers": "python_version >= '3.8'", - "version": "==4.8.0" + "version": "==4.9.0" }, "urllib3": { "hashes": [ "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54" ], - "markers": "python_version >= '3.6'", + "markers": "python_version >= '3.8'", "version": "==2.1.0" }, "yarl": { diff --git a/backend/tests/api/api_v1/test_acmgseqvar.py b/backend/tests/api/api_v1/test_acmgseqvar.py index 26480e0e..8671a525 100644 --- a/backend/tests/api/api_v1/test_acmgseqvar.py +++ b/backend/tests/api/api_v1/test_acmgseqvar.py @@ -30,7 +30,7 @@ def acmgseqvar_post_data() -> dict[str, Any]: } -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_create_acmgseqvar( db_session: AsyncSession, @@ -51,7 +51,7 @@ async def test_create_acmgseqvar( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_acmgseqvar_superuser( db_session: AsyncSession, @@ -72,7 +72,7 @@ async def test_create_acmgseqvar_superuser( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_acmgseqvar_anon( db_session: AsyncSession, client: TestClient, acmgseqvar_post_data: dict[str, Any] ): @@ -86,7 +86,7 @@ async def test_create_acmgseqvar_anon( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_acmgseqvar_invalid_data( db_session: AsyncSession, @@ -102,7 +102,7 @@ async def test_create_acmgseqvar_invalid_data( assert response.status_code == 422 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_acmgseqvar_invalid_enums( db_session: AsyncSession, @@ -126,7 +126,7 @@ async def test_create_acmgseqvar_invalid_enums( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_all_acmgseqvars( db_session: AsyncSession, @@ -151,7 +151,7 @@ async def test_list_all_acmgseqvars( assert content == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_acmgseqvars_superuser( db_session: AsyncSession, @@ -178,7 +178,7 @@ async def test_list_all_acmgseqvars_superuser( assert content[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_all_acmgseqvars_anon(db_session: AsyncSession, client: TestClient): """Test listing all acmgseqvars as anonymous user.""" _ = db_session @@ -189,7 +189,7 @@ async def test_list_all_acmgseqvars_anon(db_session: AsyncSession, client: TestC assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_no_acmgseqvars( db_session: AsyncSession, @@ -211,7 +211,7 @@ async def test_list_all_no_acmgseqvars( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_by_id_acmgseqvar( db_session: AsyncSession, @@ -239,7 +239,7 @@ async def test_get_by_id_acmgseqvar( assert content == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_by_id_acmgseqvar_superuser( db_session: AsyncSession, @@ -269,7 +269,7 @@ async def test_get_by_id_acmgseqvar_superuser( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_by_id_acmgseqvar_anon(db_session: AsyncSession, client: TestClient): """Test getting a acmgseqvar as anonymous user.""" _ = db_session @@ -280,7 +280,7 @@ async def test_get_by_id_acmgseqvar_anon(db_session: AsyncSession, client: TestC assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_acmgseqvar_by_invalid_id( db_session: AsyncSession, @@ -301,7 +301,7 @@ async def test_get_acmgseqvar_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_acmgseqvars( db_session: AsyncSession, @@ -328,7 +328,7 @@ async def test_list_acmgseqvars( assert content[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_acmgseqvars_superuser( db_session: AsyncSession, @@ -355,7 +355,7 @@ async def test_list_acmgseqvars_superuser( assert content[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_acmgseqvars_anon(db_session: AsyncSession, client: TestClient): """Test listing acmgseqvars as anonymous user.""" _ = db_session @@ -366,7 +366,7 @@ async def test_list_acmgseqvars_anon(db_session: AsyncSession, client: TestClien assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_no_acmgseqvars( db_session: AsyncSession, @@ -388,7 +388,7 @@ async def test_list_no_acmgseqvars( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_acmgseqvar( db_session: AsyncSession, @@ -415,7 +415,7 @@ async def test_get_acmgseqvar( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_acmgseqvar_superuser( db_session: AsyncSession, @@ -442,7 +442,7 @@ async def test_get_acmgseqvar_superuser( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_acmgseqvar_anon(db_session: AsyncSession, client: TestClient): """Test getting a acmgseqvar as anonymous user.""" _ = db_session @@ -453,7 +453,7 @@ async def test_get_acmgseqvar_anon(db_session: AsyncSession, client: TestClient) assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_no_acmgseqvar( db_session: AsyncSession, @@ -491,7 +491,7 @@ def acmgseqvar_update_data() -> dict[str, Any]: } -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_update_acmgseqvar( db_session: AsyncSession, @@ -520,7 +520,7 @@ async def test_update_acmgseqvar( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_acmgseqvar_superuser( db_session: AsyncSession, @@ -549,7 +549,7 @@ async def test_update_acmgseqvar_superuser( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_update_acmgseqvar_anon( db_session: AsyncSession, client: TestClient, acmgseqvar_update_data: dict[str, Any] ): @@ -563,7 +563,7 @@ async def test_update_acmgseqvar_anon( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_acmgseqvar_patch( db_session: AsyncSession, @@ -592,7 +592,7 @@ async def test_update_acmgseqvar_patch( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_acmgseqvar_no_acmgseqvar( db_session: AsyncSession, @@ -610,7 +610,7 @@ async def test_update_acmgseqvar_no_acmgseqvar( assert response.json() == {"detail": "ACMG Sequence Variant not found"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_acmgseqvar_invalid_enum( db_session: AsyncSession, @@ -642,7 +642,7 @@ async def test_update_acmgseqvar_invalid_enum( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_acmgseqvar_by_id( db_session: AsyncSession, @@ -669,7 +669,7 @@ async def test_delete_acmgseqvar_by_id( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_acmgseqvar_by_id_superuser( db_session: AsyncSession, @@ -699,7 +699,7 @@ async def test_delete_acmgseqvar_by_id_superuser( assert content["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_acmgseqvar_by_id_anon(db_session: AsyncSession, client: TestClient): """Test deleting a acmgseqvar by id as anonymous user.""" _ = db_session @@ -710,7 +710,7 @@ async def test_delete_acmgseqvar_by_id_anon(db_session: AsyncSession, client: Te assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_acmgseqvar_by_invalid_id( db_session: AsyncSession, @@ -731,7 +731,7 @@ async def test_delete_acmgseqvar_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_acmgseqvar( db_session: AsyncSession, @@ -763,7 +763,7 @@ async def test_delete_acmgseqvar( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_acmgseqvar_superuser( db_session: AsyncSession, @@ -795,7 +795,7 @@ async def test_delete_acmgseqvar_superuser( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_acmgseqvar_anon(db_session: AsyncSession, client: TestClient): """Test deleting a acmgseqvar as anonymous user.""" _ = db_session @@ -806,7 +806,7 @@ async def test_delete_acmgseqvar_anon(db_session: AsyncSession, client: TestClie assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_acmgseqvar_no_acmgseqvar( db_session: AsyncSession, diff --git a/backend/tests/api/api_v1/test_adminmsgs.py b/backend/tests/api/api_v1/test_adminmsgs.py index b334b585..1f0e9dde 100644 --- a/backend/tests/api/api_v1/test_adminmsgs.py +++ b/backend/tests/api/api_v1/test_adminmsgs.py @@ -5,7 +5,7 @@ from app.core.config import settings -@pytest.mark.asyncio +@pytest.mark.anyio async def test_adminmsgs_list(db_session: AsyncSession, client: TestClient): """Test proxying to annonars backend.""" _ = db_session # via ``get_db()`` dependency injection diff --git a/backend/tests/api/api_v1/test_bookmarks.py b/backend/tests/api/api_v1/test_bookmarks.py index 712a224e..f4d44a4a 100644 --- a/backend/tests/api/api_v1/test_bookmarks.py +++ b/backend/tests/api/api_v1/test_bookmarks.py @@ -12,7 +12,7 @@ # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_create_bookmark( db_session: AsyncSession, @@ -31,7 +31,7 @@ async def test_create_bookmark( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_bookmark_superuser( db_session: AsyncSession, @@ -50,7 +50,7 @@ async def test_create_bookmark_superuser( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_bookmark_anon(db_session: AsyncSession, client: TestClient): """Test creating a bookmark as anonymous user.""" _ = db_session @@ -62,7 +62,7 @@ async def test_create_bookmark_anon(db_session: AsyncSession, client: TestClient assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_bookmark_invalid_data( db_session: AsyncSession, @@ -83,7 +83,7 @@ async def test_create_bookmark_invalid_data( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_all_bookmarks( db_session: AsyncSession, @@ -104,7 +104,7 @@ async def test_list_all_bookmarks( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_bookmarks_superuser( db_session: AsyncSession, @@ -127,7 +127,7 @@ async def test_list_all_bookmarks_superuser( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_all_bookmarks_anon(db_session: AsyncSession, client: TestClient): """Test listing all bookmarks as anonymous user.""" _ = db_session @@ -136,7 +136,7 @@ async def test_list_all_bookmarks_anon(db_session: AsyncSession, client: TestCli assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_no_bookmarks( db_session: AsyncSession, @@ -155,7 +155,7 @@ async def test_list_all_no_bookmarks( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_bookmark_by_id( db_session: AsyncSession, @@ -168,7 +168,7 @@ async def test_get_bookmark_by_id( assert response.status_code == 401 # Forbidden access should be 403 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_bookmark_by_id_superuser( db_session: AsyncSession, @@ -191,7 +191,7 @@ async def test_get_bookmark_by_id_superuser( assert response.json()["id"] == bookmark_id -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_bookmark_by_id_anon(db_session: AsyncSession, client: TestClient): """Test getting a bookmark by id as anonymous user.""" _ = db_session @@ -201,7 +201,7 @@ async def test_get_bookmark_by_id_anon(db_session: AsyncSession, client: TestCli assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_bookmark_by_invalid_id( db_session: AsyncSession, @@ -220,7 +220,7 @@ async def test_get_bookmark_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_bookmark_by_id( db_session: AsyncSession, @@ -248,7 +248,7 @@ async def test_delete_bookmark_by_id( assert response.json()[0]["id"] == bookmark_id -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_bookmark_by_id_superuser( db_session: AsyncSession, @@ -275,7 +275,7 @@ async def test_delete_bookmark_by_id_superuser( assert response.status_code == 404 # Not Found -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_bookmark_by_id_anon(db_session: AsyncSession, client: TestClient): """Test deleting a bookmark by id as anonymous user.""" _ = db_session @@ -285,7 +285,7 @@ async def test_delete_bookmark_by_id_anon(db_session: AsyncSession, client: Test assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_bookmark_by_invalid_id( db_session: AsyncSession, @@ -305,7 +305,7 @@ async def test_delete_bookmark_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_bookmarks( db_session: AsyncSession, @@ -328,7 +328,7 @@ async def test_list_bookmarks( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_bookmarks_superuser( db_session: AsyncSession, @@ -351,7 +351,7 @@ async def test_list_bookmarks_superuser( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_bookmarks_anon(db_session: AsyncSession, client: TestClient): """Test listing bookmarks as anonymous user.""" _ = db_session @@ -360,7 +360,7 @@ async def test_list_bookmarks_anon(db_session: AsyncSession, client: TestClient) assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_no_bookmarks( db_session: AsyncSession, @@ -378,7 +378,7 @@ async def test_list_no_bookmarks( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_bookmark( db_session: AsyncSession, @@ -403,7 +403,7 @@ async def test_get_bookmark( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_bookmark_superuser( db_session: AsyncSession, @@ -428,7 +428,7 @@ async def test_get_bookmark_superuser( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_bookmark_anon(db_session: AsyncSession, client: TestClient): """Test getting a bookmark as anonymous user.""" _ = db_session @@ -437,7 +437,7 @@ async def test_get_bookmark_anon(db_session: AsyncSession, client: TestClient): assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_no_bookmarks( db_session: AsyncSession, @@ -457,7 +457,7 @@ async def test_get_no_bookmarks( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_bookmark( db_session: AsyncSession, @@ -485,7 +485,7 @@ async def test_delete_bookmark( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_bookmark_superuser( db_session: AsyncSession, @@ -513,7 +513,7 @@ async def test_delete_bookmark_superuser( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_bookmark_anon(db_session: AsyncSession, client: TestClient): """Test deleting a bookmark as anonymous user.""" _ = db_session @@ -524,7 +524,7 @@ async def test_delete_bookmark_anon(db_session: AsyncSession, client: TestClient assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_no_bookmarks( db_session: AsyncSession, diff --git a/backend/tests/api/api_v1/test_caseinfo.py b/backend/tests/api/api_v1/test_caseinfo.py index 07d25722..bf939067 100644 --- a/backend/tests/api/api_v1/test_caseinfo.py +++ b/backend/tests/api/api_v1/test_caseinfo.py @@ -12,7 +12,7 @@ # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_create_caseinfo( db_session: AsyncSession, @@ -50,7 +50,7 @@ async def test_create_caseinfo( assert response.json()["family_segregation"] == True -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_caseinfo_superuser( db_session: AsyncSession, @@ -69,7 +69,7 @@ async def test_create_caseinfo_superuser( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_caseinfo_anon(db_session: AsyncSession, client: TestClient): """Test creating a caseinfo as anonymous user.""" _ = db_session @@ -81,7 +81,7 @@ async def test_create_caseinfo_anon(db_session: AsyncSession, client: TestClient assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_caseinfo_invalid_data( db_session: AsyncSession, @@ -97,7 +97,7 @@ async def test_create_caseinfo_invalid_data( assert response.status_code == 422 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_caseinfo_invalid_enums( db_session: AsyncSession, @@ -113,7 +113,7 @@ async def test_create_caseinfo_invalid_enums( assert response.status_code == 422 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_create_caseinfo_invalid_terms( db_session: AsyncSession, @@ -134,7 +134,7 @@ async def test_create_caseinfo_invalid_terms( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_all_caseinfos( db_session: AsyncSession, @@ -155,7 +155,7 @@ async def test_list_all_caseinfos( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_caseinfos_superuser( db_session: AsyncSession, @@ -178,7 +178,7 @@ async def test_list_all_caseinfos_superuser( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_all_caseinfos_anon(db_session: AsyncSession, client: TestClient): """Test listing all caseinfos as anonymous user.""" _ = db_session @@ -187,7 +187,7 @@ async def test_list_all_caseinfos_anon(db_session: AsyncSession, client: TestCli assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_all_no_caseinfos( db_session: AsyncSession, @@ -206,7 +206,7 @@ async def test_list_all_no_caseinfos( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_caseinfo_by_id( db_session: AsyncSession, @@ -219,7 +219,7 @@ async def test_get_caseinfo_by_id( assert response.status_code == 401 # Forbidden access should be 403 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_caseinfo_by_id_superuser( db_session: AsyncSession, @@ -243,7 +243,7 @@ async def test_get_caseinfo_by_id_superuser( assert response.json()["id"] == caseinfo_id -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_caseinfo_by_id_anon(db_session: AsyncSession, client: TestClient): """Test getting a caseinfo by id as anonymous user.""" _ = db_session @@ -253,7 +253,7 @@ async def test_get_caseinfo_by_id_anon(db_session: AsyncSession, client: TestCli assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_caseinfo_by_invalid_id( db_session: AsyncSession, @@ -272,7 +272,7 @@ async def test_get_caseinfo_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_caseinfo_by_id( db_session: AsyncSession, @@ -300,7 +300,7 @@ async def test_delete_caseinfo_by_id( assert response.json()[0]["id"] == caseinfo_id -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_caseinfo_by_id_superuser( db_session: AsyncSession, @@ -327,7 +327,7 @@ async def test_delete_caseinfo_by_id_superuser( assert response.status_code == 404 # Not Found -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_caseinfo_by_id_anon(db_session: AsyncSession, client: TestClient): """Test deleting a caseinfo by id as anonymous user.""" _ = db_session @@ -337,7 +337,7 @@ async def test_delete_caseinfo_by_id_anon(db_session: AsyncSession, client: Test assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_caseinfo_by_invalid_id( db_session: AsyncSession, @@ -357,7 +357,7 @@ async def test_delete_caseinfo_by_invalid_id( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_list_caseinfo( db_session: AsyncSession, @@ -380,7 +380,7 @@ async def test_list_caseinfo( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_caseinfo_superuser( db_session: AsyncSession, @@ -403,7 +403,7 @@ async def test_list_caseinfo_superuser( assert response.json()[0]["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_list_caseinfo_anon(db_session: AsyncSession, client: TestClient): """Test listing caseinfos as anonymous user.""" _ = db_session @@ -412,7 +412,7 @@ async def test_list_caseinfo_anon(db_session: AsyncSession, client: TestClient): assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_list_no_caseinfo( db_session: AsyncSession, @@ -430,7 +430,7 @@ async def test_list_no_caseinfo( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_get_caseinfo( db_session: AsyncSession, @@ -453,7 +453,7 @@ async def test_get_caseinfo( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_caseinfo_superuser( db_session: AsyncSession, @@ -476,7 +476,7 @@ async def test_get_caseinfo_superuser( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_caseinfo_anon(db_session: AsyncSession, client: TestClient): """Test getting a caseinfo as anonymous user.""" _ = db_session @@ -485,7 +485,7 @@ async def test_get_caseinfo_anon(db_session: AsyncSession, client: TestClient): assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_get_no_caseinfo( db_session: AsyncSession, @@ -503,7 +503,7 @@ async def test_get_no_caseinfo( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_update_caseinfo( db_session: AsyncSession, @@ -529,7 +529,7 @@ async def test_update_caseinfo( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_caseinfo_superuser( db_session: AsyncSession, @@ -555,7 +555,7 @@ async def test_update_caseinfo_superuser( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_update_caseinfo_anon(db_session: AsyncSession, client: TestClient): """Test updating a caseinfo as anonymous user.""" _ = db_session @@ -567,7 +567,7 @@ async def test_update_caseinfo_anon(db_session: AsyncSession, client: TestClient assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_caseinfo_patch( db_session: AsyncSession, @@ -593,7 +593,7 @@ async def test_update_caseinfo_patch( assert response.json()["user"] == str(test_user.id) -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_no_caseinfo( db_session: AsyncSession, @@ -609,7 +609,7 @@ async def test_update_no_caseinfo( assert response.json() == {"detail": "Case Information not found"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_caseinfo_invalid_enum( db_session: AsyncSession, @@ -632,7 +632,7 @@ async def test_update_caseinfo_invalid_enum( assert response.status_code == 422 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_update_caseinfo_invalid_terms( db_session: AsyncSession, @@ -664,7 +664,7 @@ async def test_update_caseinfo_invalid_terms( # ------------------------------------------------------------------------------ -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_delete_caseinfo( db_session: AsyncSession, @@ -689,7 +689,7 @@ async def test_delete_caseinfo( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_caseinfo_superuser( db_session: AsyncSession, @@ -714,7 +714,7 @@ async def test_delete_caseinfo_superuser( assert response.status_code == 404 -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_caseinfo_anon(db_session: AsyncSession, client: TestClient): """Test deleting a caseinfo as anonymous user.""" _ = db_session @@ -723,7 +723,7 @@ async def test_delete_caseinfo_anon(db_session: AsyncSession, client: TestClient assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_delete_no_caseinfo( db_session: AsyncSession, diff --git a/backend/tests/api/api_v1/test_utils.py b/backend/tests/api/api_v1/test_utils.py index 5aaf8fb9..604a4332 100644 --- a/backend/tests/api/api_v1/test_utils.py +++ b/backend/tests/api/api_v1/test_utils.py @@ -6,7 +6,7 @@ from app.models.user import User -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(False, False)], indirect=True) async def test_test_email( db_session: AsyncSession, @@ -23,7 +23,7 @@ async def test_test_email( assert response.json() == {"detail": "Unauthorized"} -@pytest.mark.asyncio +@pytest.mark.anyio @pytest.mark.parametrize("test_user, client_user", [(True, True)], indirect=True) async def test_test_email_superuser( db_session: AsyncSession, @@ -43,7 +43,7 @@ async def test_test_email_superuser( assert response.json() == {"msg": "Test email sent"} -@pytest.mark.asyncio +@pytest.mark.anyio async def test_test_email_anon(db_session: AsyncSession, client: TestClient): """Test sending an email as anonymous user.""" _ = db_session diff --git a/backend/tests/api/internal/test_proxy.py b/backend/tests/api/internal/test_proxy.py index 05f48a19..20dfe7c7 100644 --- a/backend/tests/api/internal/test_proxy.py +++ b/backend/tests/api/internal/test_proxy.py @@ -12,7 +12,7 @@ MOCKED_URL_TOKEN = "xXTeStXxx" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_annonars(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to annonars backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_ANNONARS", f"http://{MOCKED_BACKEND_HOST}") @@ -27,7 +27,7 @@ async def test_proxy_annonars(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, c assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_mehari(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to mehari backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_MEHARI", f"http://{MOCKED_BACKEND_HOST}") @@ -42,7 +42,7 @@ async def test_proxy_mehari(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, cli assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_viguno(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to viguno backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_VIGUNO", f"http://{MOCKED_BACKEND_HOST}") @@ -57,7 +57,7 @@ async def test_proxy_viguno(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, cli assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_nginx(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to nginx backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_NGINX", f"http://{MOCKED_BACKEND_HOST}") @@ -72,7 +72,7 @@ async def test_proxy_nginx(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, clie assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_dotty(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to dotty backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_DOTTY", f"http://{MOCKED_BACKEND_HOST}") @@ -87,7 +87,7 @@ async def test_proxy_dotty(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, clie assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_proxy_cada_prio(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, client: TestClient): """Test proxying to cada-prio backend.""" monkeypatch.setattr(settings, "BACKEND_PREFIX_CADA_PRIO", f"http://{MOCKED_BACKEND_HOST}") @@ -102,7 +102,7 @@ async def test_proxy_cada_prio(monkeypatch: MonkeyPatch, httpx_mock: HTTPXMock, assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_invalid_proxy_route(client: TestClient): """Test invalid proxy route.""" response = client.get("/internal/proxy/some-other-path") diff --git a/backend/tests/api/internal/test_remote.py b/backend/tests/api/internal/test_remote.py index 7210c11a..83b260ea 100644 --- a/backend/tests/api/internal/test_remote.py +++ b/backend/tests/api/internal/test_remote.py @@ -11,7 +11,7 @@ MOCKED_URL_TOKEN = "xXTeStXxx" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_variantvalidator(httpx_mock: HTTPXMock, client: TestClient): """Test variant validator endpoint.""" variantvalidator_url = "https://rest.variantvalidator.org/VariantValidator/variantvalidator" @@ -26,7 +26,7 @@ async def test_variantvalidator(httpx_mock: HTTPXMock, client: TestClient): assert response.text == "Mocked response" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_acmg(httpx_mock: HTTPXMock, client: TestClient): """Test ACMG endpoint.""" acmg_url = "http://wintervar.wglab.org/api_new.php" @@ -42,7 +42,7 @@ async def test_acmg(httpx_mock: HTTPXMock, client: TestClient): assert response.json() == default_acmg_rating() -@pytest.mark.asyncio +@pytest.mark.anyio async def test_acmg_missing_query_params(client: TestClient): """Test ACMG endpoint with missing query parameters.""" response = client.get("/internal/remote/acmg") diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index 2a3feadb..dda8831d 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -2,7 +2,6 @@ from typing import AsyncGenerator, Iterator import pytest -import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch from fastapi.testclient import TestClient from sqlalchemy import StaticPool @@ -21,6 +20,11 @@ from app.models.user import User +@pytest.fixture +def anyio_backend(): + return "asyncio" + + @pytest.fixture() def db_engine() -> Iterator[AsyncEngine]: # setup engine with in-memory sqlite for testing @@ -32,7 +36,7 @@ def db_engine() -> Iterator[AsyncEngine]: yield engine -@pytest_asyncio.fixture() +@pytest.fixture() async def db_session( db_engine: AsyncEngine, monkeypatch: MonkeyPatch ) -> AsyncGenerator[AsyncSession, None]: diff --git a/backend/tests/crud/test_acmgseqvar.py b/backend/tests/crud/test_acmgseqvar.py index 375b6edc..251a8575 100644 --- a/backend/tests/crud/test_acmgseqvar.py +++ b/backend/tests/crud/test_acmgseqvar.py @@ -33,7 +33,7 @@ def acmgseqvar_create() -> AcmgSeqVarCreate: ) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_get_acmgseqvar(db_session: AsyncSession, acmgseqvar_create: AcmgSeqVarCreate): """Test creating and retrieving a acmgseqvar.""" acmgseqvar_postcreate = await crud.acmgseqvar.create( @@ -49,7 +49,7 @@ async def test_create_get_acmgseqvar(db_session: AsyncSession, acmgseqvar_create assert acmgseqvar_postcreate.acmg_rank == stored_item.acmg_rank -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_acmgseqvar(db_session: AsyncSession, acmgseqvar_create: AcmgSeqVarCreate): """Test deleting a acmgseqvar.""" acmgseqvar_postcreate = await crud.acmgseqvar.create( @@ -58,7 +58,7 @@ async def test_delete_acmgseqvar(db_session: AsyncSession, acmgseqvar_create: Ac await crud.acmgseqvar.remove(session=db_session, id=acmgseqvar_postcreate.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_multi_by_user(db_session: AsyncSession, acmgseqvar_create: AcmgSeqVarCreate): """Test get_multi_by_user.""" acmgseqvar_postcreate = await crud.acmgseqvar.create( @@ -74,7 +74,7 @@ async def test_get_multi_by_user(db_session: AsyncSession, acmgseqvar_create: Ac assert acmgseqvar_postcreate.acmg_rank == stored_item[0].acmg_rank -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_by_user(db_session: AsyncSession, acmgseqvar_create: AcmgSeqVarCreate): """Test get_by_user.""" acmgseqvar_postcreate = await crud.acmgseqvar.create( diff --git a/backend/tests/crud/test_adminmsg.py b/backend/tests/crud/test_adminmsg.py index ddea162e..5b7f4d47 100644 --- a/backend/tests/crud/test_adminmsg.py +++ b/backend/tests/crud/test_adminmsg.py @@ -18,7 +18,7 @@ def adminmessage_create(faker: typing.Any) -> AdminMessageCreate: ) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_get_adminmessage( db_session: AsyncSession, adminmessage_create: AdminMessageCreate ): @@ -33,7 +33,7 @@ async def test_create_get_adminmessage( assert adminmessage_postcreate.active_stop == stored_item.active_stop -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_update_adminmessage( db_session: AsyncSession, faker: typing.Any, adminmessage_create: AdminMessageCreate ) -> None: @@ -50,7 +50,7 @@ async def test_create_update_adminmessage( assert adminmessage_postupdate.title == adminmessage_update.title -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_adminmessage( db_session: AsyncSession, adminmessage_create: AdminMessageCreate ): diff --git a/backend/tests/crud/test_bookmark.py b/backend/tests/crud/test_bookmark.py index c7447436..579a9d89 100644 --- a/backend/tests/crud/test_bookmark.py +++ b/backend/tests/crud/test_bookmark.py @@ -17,7 +17,7 @@ def bookmark_create() -> BookmarkCreate: ) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_get_bookmark(db_session: AsyncSession, bookmark_create: BookmarkCreate): """Test creating and retrieving a bookmark.""" bookmark_postcreate = await crud.bookmark.create(session=db_session, obj_in=bookmark_create) @@ -28,14 +28,14 @@ async def test_create_get_bookmark(db_session: AsyncSession, bookmark_create: Bo assert bookmark_postcreate.obj_id == stored_item.obj_id -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_bookmark(db_session: AsyncSession, bookmark_create: BookmarkCreate): """Test deleting a bookmark.""" bookmark_postcreate = await crud.bookmark.create(session=db_session, obj_in=bookmark_create) await crud.bookmark.remove(session=db_session, id=bookmark_postcreate.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_multi_by_user(db_session: AsyncSession, bookmark_create: BookmarkCreate): """Test retrieving multiple bookmarks by user.""" bookmark_postcreate = await crud.bookmark.create(session=db_session, obj_in=bookmark_create) @@ -49,7 +49,7 @@ async def test_get_multi_by_user(db_session: AsyncSession, bookmark_create: Book assert bookmark_postcreate.obj_id == stored_items[0].obj_id -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_by_user_and_obj(db_session: AsyncSession, bookmark_create: BookmarkCreate): """Test retrieving a bookmark by user and object.""" bookmark_postcreate = await crud.bookmark.create(session=db_session, obj_in=bookmark_create) diff --git a/backend/tests/crud/test_caseinfo.py b/backend/tests/crud/test_caseinfo.py index 59ecccff..83596691 100644 --- a/backend/tests/crud/test_caseinfo.py +++ b/backend/tests/crud/test_caseinfo.py @@ -33,7 +33,7 @@ def case_create() -> CaseInfoCreate: ) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_create_get_caseinfo(db_session: AsyncSession, case_create: CaseInfoCreate): """Test creating and retrieving a caseinfo.""" caseinfo_postcreate = await crud.caseinfo.create(session=db_session, obj_in=case_create) @@ -52,14 +52,14 @@ async def test_create_get_caseinfo(db_session: AsyncSession, case_create: CaseIn assert caseinfo_postcreate.family_segregation == stored_item.family_segregation -@pytest.mark.asyncio +@pytest.mark.anyio async def test_delete_caseinfo(db_session: AsyncSession, case_create: CaseInfoCreate): """Test deleting a caseinfo.""" caseinfo_postcreate = await crud.caseinfo.create(session=db_session, obj_in=case_create) await crud.caseinfo.remove(session=db_session, id=caseinfo_postcreate.id) -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_multi_by_user(db_session: AsyncSession, case_create: CaseInfoCreate): """Test retrieving multiple caseinfos by user.""" caseinfo_postcreate = await crud.caseinfo.create(session=db_session, obj_in=case_create) @@ -81,7 +81,7 @@ async def test_get_multi_by_user(db_session: AsyncSession, case_create: CaseInfo assert caseinfo_postcreate.family_segregation == stored_items[0].family_segregation -@pytest.mark.asyncio +@pytest.mark.anyio async def test_get_by_user(db_session: AsyncSession, case_create: CaseInfoCreate): """Test retrieving a caseinfo by user.""" caseinfo_postcreate = await crud.caseinfo.create(session=db_session, obj_in=case_create) diff --git a/backend/tests/test_main.py b/backend/tests/test_main.py index 8d11119a..1a142ed8 100644 --- a/backend/tests/test_main.py +++ b/backend/tests/test_main.py @@ -5,7 +5,7 @@ from app.core.config import settings -@pytest.mark.asyncio +@pytest.mark.anyio async def test_version(monkeypatch: MonkeyPatch, client: TestClient): """Test version endpoint.""" monkeypatch.setattr(settings, "REEV_VERSION", "1.2.3") @@ -14,7 +14,7 @@ async def test_version(monkeypatch: MonkeyPatch, client: TestClient): assert response.text == "1.2.3" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_version_no_version(monkeypatch: MonkeyPatch, fp, client: TestClient): """Test version endpoint with no version.""" monkeypatch.setattr(settings, "REEV_VERSION", None) @@ -27,7 +27,7 @@ async def test_version_no_version(monkeypatch: MonkeyPatch, fp, client: TestClie assert response.text == "v0.0.0-16-g7a4205d-dirty" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_favicon(client: TestClient): """Test favicon endpoint.""" response = client.get("/favicon.ico") @@ -35,7 +35,7 @@ async def test_favicon(client: TestClient): assert response.headers["content-type"] == "image/vnd.microsoft.icon" -@pytest.mark.asyncio +@pytest.mark.anyio async def test_frontend_settings(monkeypatch: MonkeyPatch, client: TestClient): """Test frontend settings endpoint.""" monkeypatch.setattr(settings, "MATOMO_HOST", "matomo.example.com") @@ -45,7 +45,7 @@ async def test_frontend_settings(monkeypatch: MonkeyPatch, client: TestClient): assert response.json() == {"matomo_host": "matomo.example.com", "matomo_site_id": 42} -@pytest.mark.asyncio +@pytest.mark.anyio async def test_frontend_settings_no_matomo(monkeypatch: MonkeyPatch, client: TestClient): """Test frontend settings endpoint with no matomo.""" monkeypatch.setattr(settings, "MATOMO_HOST", None)