refactor: rename sessions submodule to _sessions to avoid shadowing sessions()
wabot/__init__.py defines def sessions(...) and also had a sessions.py submodule, so wabot.sessions (attribute) resolved to the function, shadowing the module for import wabot.sessions as m style access. This is the same class of collision that browser.py -> _browser.py already fixed. Renaming to _sessions.py removes the ambiguity and lets docs/api.rst drop the :no-index: Sphinx workaround in favor of plain autoclass directives on the public SessionRecord/SessionStore re-exports.
This commit is contained in:
@@ -36,6 +36,6 @@ def site_url():
|
||||
|
||||
@pytest.fixture
|
||||
def store(tmp_path):
|
||||
from wabot.sessions import SessionStore
|
||||
from wabot import SessionStore
|
||||
|
||||
return SessionStore(path=tmp_path / "sessions.json")
|
||||
|
||||
@@ -15,7 +15,7 @@ REATTACH_SCRIPT = textwrap.dedent(
|
||||
"""
|
||||
import json, sys
|
||||
import wabot
|
||||
from wabot.sessions import SessionStore
|
||||
from wabot import SessionStore
|
||||
|
||||
store = SessionStore(path=sys.argv[1])
|
||||
bot = wabot.browser(session=sys.argv[2], pacing=wabot.NoPacing(), store=store)
|
||||
|
||||
Reference in New Issue
Block a user