Skip to content

Commit

Permalink
Improve pytest detection
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Aug 17, 2024
1 parent 2e1895f commit e79032d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webview/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_app_root() -> str:
if getattr(sys, 'frozen', False): # cx_freeze
return os.path.dirname(sys.executable)

if os.getenv('PYTEST_CURRENT_TEST'):
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))
Expand Down

0 comments on commit e79032d

Please sign in to comment.