fix: drop conftest sys.path hack; rely on pytest pythonpath
This commit is contained in:
+2
-8
@@ -6,19 +6,15 @@ import importlib.util
|
||||
import json
|
||||
import shutil
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
# Repo root on sys.path for `slack_export` / `server` (CI and local).
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
|
||||
import pytest
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
FIXTURE_EXPORT = REPO_ROOT / "tests" / "fixtures" / "mini-export"
|
||||
TEST_MANIFEST = REPO_ROOT / "tests" / "fixtures" / "test-manifest.json"
|
||||
|
||||
@@ -47,7 +43,6 @@ def fixture_export_path() -> Path:
|
||||
|
||||
@pytest.fixture
|
||||
def export(fixture_export_path):
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
from slack_export import SlackExport
|
||||
|
||||
return SlackExport(fixture_export_path)
|
||||
@@ -93,7 +88,6 @@ def review_server(tmp_path_factory):
|
||||
import threading
|
||||
from http.server import ThreadingHTTPServer
|
||||
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
from server import ReviewHandler
|
||||
from slack_export import SlackExport
|
||||
|
||||
|
||||
Reference in New Issue
Block a user