Skip to content

Commit

Permalink
Appveyor debug
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Oct 13, 2024
1 parent 942d590 commit e57bcf1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion tests/test_simple_browser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import webview

from .util import run_test

from logging import getLogger
logger = getLogger('pywebview')
logger.setLevel('DEBUG')

def test_simple_browser():
logger.info('test_simple_browser')
window = webview.create_window('Simple browser test', 'https://www.example.org')
logger.info('window created')

run_test(webview, window)
2 changes: 2 additions & 0 deletions webview/platforms/cocoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ def first_show(self):

BrowserView.app.activateIgnoringOtherApps_(Foundation.YES)
AppHelper.installMachInterrupt()
logger.info('Starting Cocoa app')
BrowserView.app.run()

def show(self):
Expand Down Expand Up @@ -1112,6 +1113,7 @@ def setup_app():
def create_window(window):
def create():
browser = BrowserView(window)
logger.debug('Creating Cocoa window with UID: %s', window.uid)
browser.first_show()

if window.uid == 'master':
Expand Down
6 changes: 3 additions & 3 deletions webview/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ def get_app_root() -> str:
return os.path.dirname(sys.executable)

if 'pytest' in sys.modules and os.getenv('PYTEST_CURRENT_TEST'):
test_file = os.getenv('PYTEST_CURRENT_TEST').split('::')[0]

return os.path.dirname(os.path.join(os.getcwd(), test_file))
return os.path.join(os.path.dirname(__file__), '..', 'tests')

if hasattr(sys, 'getandroidapilevel'):
return os.getenv('ANDROID_APP_PATH')
Expand All @@ -85,8 +83,10 @@ def abspath(path: str) -> str:
Make path absolute, using the application root
"""
path = os.fspath(path)
print("original path ", path)
if not os.path.isabs(path):
path = os.path.join(get_app_root(), path)
print("Result: ", os.path.normpath(path))
return os.path.normpath(path)


Expand Down

0 comments on commit e57bcf1

Please sign in to comment.