55
66def test_import_features_module ():
77 """Test that the features module can be imported without syntax errors.
8-
8+
99 This test ensures Python 3.10+ compatibility by verifying that:
1010 1. Type annotations with list[], type[], and | syntax work (via __future__ imports)
1111 2. No Python 3.11+ exclusive syntax is used (like *unpacking in subscripts)
1212 """
1313 try :
1414 import eegdash .features
15+
1516 assert eegdash .features is not None
1617 except SyntaxError as e :
1718 pytest .fail (f"SyntaxError when importing eegdash.features: { e } " )
@@ -35,13 +36,13 @@ def test_import_features_submodules():
3536 "eegdash.features.feature_bank.connectivity" ,
3637 "eegdash.features.feature_bank.csp" ,
3738 ]
38-
39+
3940 for module_name in submodules :
4041 try :
4142 __import__ (module_name )
4243 except SyntaxError as e :
4344 pytest .fail (f"SyntaxError when importing { module_name } : { e } " )
44- except ImportError as e :
45+ except ImportError :
4546 # Some imports might fail due to missing dependencies, that's ok
4647 # We only care about SyntaxError
4748 pass
@@ -50,17 +51,17 @@ def test_import_features_submodules():
5051def test_features_basic_functionality ():
5152 """Test basic features module functionality."""
5253 from eegdash .features import (
53- get_all_features ,
5454 get_all_feature_extractors ,
5555 get_all_feature_kinds ,
56+ get_all_features ,
5657 )
57-
58+
5859 # These should return lists without errors
5960 features = get_all_features ()
6061 assert isinstance (features , list )
61-
62+
6263 extractors = get_all_feature_extractors ()
6364 assert isinstance (extractors , list )
64-
65+
6566 kinds = get_all_feature_kinds ()
6667 assert isinstance (kinds , list )
0 commit comments