Skip to content

Commit 05ab640

Browse files
Update conftest.py
Improve security and efficiency of import statements.
1 parent 6f1e7e5 commit 05ab640

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ensure the repository root is on sys.path so `import cerebros` works when
22
# running tests without installing the package.
3-
import os
4-
import sys
3+
from os.path import abspath
4+
from sys import path
55

6-
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
7-
if ROOT not in sys.path:
8-
sys.path.insert(0, ROOT)
6+
ROOT = abspath(os.path.join(os.path.dirname(__file__), ".."))
7+
if ROOT not in path:
8+
path.insert(0, ROOT)

0 commit comments

Comments
 (0)