Skip to content

Commit e79032d

Browse files
committed
Improve pytest detection
1 parent 2e1895f commit e79032d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webview/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_app_root() -> str:
6868
if getattr(sys, 'frozen', False): # cx_freeze
6969
return os.path.dirname(sys.executable)
7070

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

7474
return os.path.dirname(os.path.join(os.getcwd(), test_file))

0 commit comments

Comments
 (0)