Skip to content

Commit c67b966

Browse files
cbornetStefano Lottini
andauthored
Activate PTH rules (#60)
Co-authored-by: Stefano Lottini <[email protected]>
1 parent b04fb22 commit c67b966

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

libs/astradb/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ ignore = [
7676
"ERA", # Do we want to activate (no commented code) ?
7777
"ISC001", # Messes with the formatter
7878
"PLR09", # TODO: do we enforce these ones (complexity) ?
79-
"PTH", # Do we want to activate (use pathlib) ?
8079

8180
"BLE001", # TODO
8281
"PT011", # TODO
8382
"PT012", # TODO
8483
"D101", # TODO
8584
"D417", # TODO
86-
"PTH", # TODO
8785

8886
]
8987

libs/astradb/tests/integration_tests/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
from __future__ import annotations
22

33
import os
4+
from pathlib import Path
45
from typing import TypedDict
56

67
import pytest
78
from astrapy import Database
89
from astrapy.db import AstraDB
910

1011
# Getting the absolute path of the current file's directory
11-
ABS_PATH = os.path.dirname(os.path.abspath(__file__))
12+
ABS_PATH = (Path(__file__)).parent
1213

1314
# Getting the absolute path of the project's root directory
14-
PROJECT_DIR = os.path.abspath(os.path.join(ABS_PATH, os.pardir, os.pardir))
15+
PROJECT_DIR = Path(ABS_PATH).parent.parent
1516

1617

1718
# Loading the .env file if it exists
1819
def _load_env() -> None:
19-
dotenv_path = os.path.join(PROJECT_DIR, "tests", "integration_tests", ".env")
20-
if os.path.exists(dotenv_path):
20+
dotenv_path = Path(PROJECT_DIR) / "tests" / "integration_tests" / ".env"
21+
if Path(dotenv_path).exists():
2122
from dotenv import load_dotenv
2223

2324
load_dotenv(dotenv_path)

0 commit comments

Comments
 (0)