Skip to content

Commit

Permalink
tests: actually autoloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Spitfire1900 committed Dec 3, 2024
1 parent 93ce97d commit 8948af0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/test_xontrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,24 @@ def test_it_loads(load_xontrib):

@pytest.fixture(scope="module", autouse=True)
def xsh():
from xonsh.__amalgam__ import _autoload_xontribs
from xonsh.built_ins import XSH # Xonsh session singleton
# from xonsh.built_ins import XonshSession as XSH # Xonsh session singleton
from xonsh.environ import default_env

# XSH.load(env=default_env())
XSH.load()
_autoload_xontribs({})

# XSH.load(env=Env(default_env({'XONTRIBS_AUTOLOAD_DISABLED':
# False}))) # has no effect
# XSH.load(env=Env(default_env({'XONTRIBS_AUTOLOAD_DISABLED':
# False}))) # has no effect
xonsh_env: Env = XSH.env # type: ignore reportAssignmentType
xonsh_env['XONSH_SHOW_TRACEBACK'] = True
shell: Shell = XSH.shell # type: ignore reportAssignmentType
from xontrib.pygitstatus import entrypoint
entrypoint._load_xontrib_(XSH)
# from xontrib.pygitstatus import entrypoint
# entrypoint._load_xontrib_(XSH)
xontib_list = shell.default(
'xontrib list'
) # pytest --capture=no -k test_clean prints this: pygitstatus loaded manual
Expand Down

0 comments on commit 8948af0

Please sign in to comment.