mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
d92b19e1b5
commit
7e19e417b5
4 changed files with 31 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue