Skip to content

Commit a71b765

Browse files
committed
Use pathlib to find fixture file
1 parent 18cc70f commit a71b765

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/tests_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
from pathlib import Path
22

33
import test_utils
44
from starlette.requests import Request
@@ -106,9 +106,9 @@ class FileAuthTests(test_utils.AsyncTestCase):
106106
def setUp(self) -> None:
107107
super().setUp()
108108

109-
my_dir = os.path.abspath(os.path.dirname(__file__))
109+
self.auth_fixture = Path(__file__).parent / "fixtures/auth-file.yml"
110110

111-
self.backend = FileBackend(path=os.path.join(my_dir, "fixtures", "auth-file.yml"))
111+
self.backend = FileBackend(path=str(self.auth_fixture))
112112

113113
def test_ok(self) -> None:
114114
scopes, user = self.await_(self.backend.validate('ABC', 'password1'))

0 commit comments

Comments
 (0)