gh-95411: IDLE - Enable using the module browser with .pyw files (#95397)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Erlend Egeberg Aasland 2022-07-30 06:42:13 +02:00 committed by GitHub
parent d92b19e1b5
commit 7e19e417b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 9 deletions

View file

@ -5,6 +5,7 @@ from test.support import requires
import unittest
from unittest import mock
from idlelib.idle_test.mock_idle import Func
from idlelib.util import py_extensions
from collections import deque
import os.path
@ -57,6 +58,15 @@ class ModuleBrowserTest(unittest.TestCase):
self.assertTrue(mb.node.destroy.called)
del mb.top.destroy, mb.node.destroy
def test_is_browseable_extension(self):
path = "/path/to/file"
for ext in py_extensions:
with self.subTest(ext=ext):
filename = f'{path}{ext}'
actual = browser.is_browseable_extension(filename)
expected = ext not in browser.browseable_extension_blocklist
self.assertEqual(actual, expected)
# Nested tree same as in test_pyclbr.py except for supers on C0. C1.
mb = pyclbr