skylos 1.1.11__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of skylos might be problematic. Click here for more details.
- skylos/analyzer.py +96 -73
- skylos/cli.py +20 -2
- skylos/constants.py +42 -0
- skylos/framework_aware.py +158 -0
- skylos/test_aware.py +66 -0
- skylos/visitor.py +28 -3
- {skylos-1.1.11.dist-info → skylos-1.2.0.dist-info}/METADATA +1 -1
- skylos-1.2.0.dist-info/RECORD +32 -0
- test/test_analyzer.py +223 -195
- test/test_changes_analyzer.py +149 -0
- test/test_constants.py +348 -0
- test/test_framework_aware.py +372 -0
- test/test_test_aware.py +328 -0
- test/test_visitor.py +0 -10
- skylos-1.1.11.dist-info/RECORD +0 -25
- {skylos-1.1.11.dist-info → skylos-1.2.0.dist-info}/WHEEL +0 -0
- {skylos-1.1.11.dist-info → skylos-1.2.0.dist-info}/entry_points.txt +0 -0
- {skylos-1.1.11.dist-info → skylos-1.2.0.dist-info}/top_level.txt +0 -0
test/test_visitor.py
CHANGED
|
@@ -77,25 +77,20 @@ class TestDefinition(unittest.TestCase):
|
|
|
77
77
|
self.assertEqual(definition.type, def_type)
|
|
78
78
|
|
|
79
79
|
class TestVisitor(unittest.TestCase):
|
|
80
|
-
"""Test the Visitor class."""
|
|
81
80
|
|
|
82
81
|
def setUp(self):
|
|
83
|
-
"""Set up test fixtures."""
|
|
84
82
|
self.temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False)
|
|
85
83
|
self.visitor = Visitor("test_module", self.temp_file.name)
|
|
86
84
|
|
|
87
85
|
def tearDown(self):
|
|
88
|
-
"""Clean up test fixtures."""
|
|
89
86
|
Path(self.temp_file.name).unlink()
|
|
90
87
|
|
|
91
88
|
def parse_and_visit(self, code):
|
|
92
|
-
"""Helper method to parse code and visit with the visitor."""
|
|
93
89
|
tree = ast.parse(code)
|
|
94
90
|
self.visitor.visit(tree)
|
|
95
91
|
return self.visitor
|
|
96
92
|
|
|
97
93
|
def test_simple_function(self):
|
|
98
|
-
"""Test detection of simple function definitions."""
|
|
99
94
|
code = """
|
|
100
95
|
def my_function():
|
|
101
96
|
pass
|
|
@@ -108,7 +103,6 @@ def my_function():
|
|
|
108
103
|
self.assertEqual(definition.simple_name, "my_function")
|
|
109
104
|
|
|
110
105
|
def test_async_function(self):
|
|
111
|
-
"""Test detection of async function definitions."""
|
|
112
106
|
code = """
|
|
113
107
|
async def async_function():
|
|
114
108
|
await some_call()
|
|
@@ -121,7 +115,6 @@ async def async_function():
|
|
|
121
115
|
self.assertEqual(definition.simple_name, "async_function")
|
|
122
116
|
|
|
123
117
|
def test_class_with_methods(self):
|
|
124
|
-
"""Test detection of classes and methods."""
|
|
125
118
|
code = """
|
|
126
119
|
class MyClass:
|
|
127
120
|
def __init__(self):
|
|
@@ -140,7 +133,6 @@ class MyClass:
|
|
|
140
133
|
"""
|
|
141
134
|
visitor = self.parse_and_visit(code)
|
|
142
135
|
|
|
143
|
-
print(f"DEBUG: Found {len(visitor.defs)} definitions:")
|
|
144
136
|
for d in visitor.defs:
|
|
145
137
|
print(f" {d.type}: {d.name}")
|
|
146
138
|
|
|
@@ -189,7 +181,6 @@ from os.path import join as path_join
|
|
|
189
181
|
self.assertEqual(visitor.alias["path_join"], "os.path.join")
|
|
190
182
|
|
|
191
183
|
def test_relative_imports(self):
|
|
192
|
-
"""Test relative import detection."""
|
|
193
184
|
code = """
|
|
194
185
|
from . import sibling_module
|
|
195
186
|
from ..parent import parent_function
|
|
@@ -209,7 +200,6 @@ from ...grandparent.utils import helper
|
|
|
209
200
|
self.assertEqual(visitor.alias["parent_function"], "package.parent_function")
|
|
210
201
|
|
|
211
202
|
def test_nested_functions(self):
|
|
212
|
-
"""Test nested function detection."""
|
|
213
203
|
code = """
|
|
214
204
|
def outer():
|
|
215
205
|
def inner():
|
skylos-1.1.11.dist-info/RECORD
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
skylos/__init__.py,sha256=ZZWhq0TZ3G-yDi9inbYvMn8OBes-pqo1aYB5EivuxFI,152
|
|
2
|
-
skylos/analyzer.py,sha256=sXLvtJ3AB946HWV9JpDiWJ4-qwcT1cKRTA3TVTx2VNU,13117
|
|
3
|
-
skylos/cli.py,sha256=7lcRFc3zailK2cPCWk6yT-EF0oeY_CmBo6TyD5m6c5Y,17355
|
|
4
|
-
skylos/visitor.py,sha256=0h07CNS6RnWi3vMjWO0sexzePRXIAfPjQib8Qxu11oY,11740
|
|
5
|
-
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
test/compare_tools.py,sha256=0g9PDeJlbst-7hOaQzrL4MiJFQKpqM8q8VeBGzpPczg,22738
|
|
7
|
-
test/conftest.py,sha256=57sTF6vLL5U0CVKwGQFJcRs6n7t1dEHIriQoSluNmAI,6418
|
|
8
|
-
test/diagnostics.py,sha256=ExuFOCVpc9BDwNYapU96vj9RXLqxji32Sv6wVF4nJYU,13802
|
|
9
|
-
test/test_analyzer.py,sha256=uHcOJjW-LDryDLFRIZgVa4TgDv2JGrUo0HPsMwh4E8I,19720
|
|
10
|
-
test/test_cli.py,sha256=rtdKzanDRJT_F92jKkCQFdhvlfwVJxfXKO8Hrbn-mIg,13180
|
|
11
|
-
test/test_integration.py,sha256=bNKGUe-w0xEZEdnoQNHbssvKMGs9u9fmFQTOz1lX9_k,12398
|
|
12
|
-
test/test_skylos.py,sha256=kz77STrS4k3Eez5RDYwGxOg2WH3e7zNZPUYEaTLbGTs,15608
|
|
13
|
-
test/test_visitor.py,sha256=sybUQtALlwl6-Nec1TalB5O6ekO9Tfia0JJZDtA7Cwc,23272
|
|
14
|
-
test/sample_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
test/sample_repo/app.py,sha256=M5XgoAn-LPz50mKAj_ZacRKf-Pg7I4HbjWP7Z9jE4a0,226
|
|
16
|
-
test/sample_repo/sample_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
test/sample_repo/sample_repo/commands.py,sha256=b6gQ9YDabt2yyfqGbOpLo0osF7wya8O4Lm7m8gtCr3g,2575
|
|
18
|
-
test/sample_repo/sample_repo/models.py,sha256=xXIg3pToEZwKuUCmKX2vTlCF_VeFA0yZlvlBVPIy5Qw,3320
|
|
19
|
-
test/sample_repo/sample_repo/routes.py,sha256=8yITrt55BwS01G7nWdESdx8LuxmReqop1zrGUKPeLi8,2475
|
|
20
|
-
test/sample_repo/sample_repo/utils.py,sha256=S56hEYh8wkzwsD260MvQcmUFOkw2EjFU27nMLFE6G2k,1103
|
|
21
|
-
skylos-1.1.11.dist-info/METADATA,sha256=LUAqpC_E7ouGZxVtjyFa1LEXrTfV8MOyrQGRnDLnHYM,225
|
|
22
|
-
skylos-1.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
-
skylos-1.1.11.dist-info/entry_points.txt,sha256=zzRpN2ByznlQoLeuLolS_TFNYSQxUGBL1EXQsAd6bIA,43
|
|
24
|
-
skylos-1.1.11.dist-info/top_level.txt,sha256=f8GA_7KwfaEopPMP8-EXDQXaqd4IbsOQPakZy01LkdQ,12
|
|
25
|
-
skylos-1.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|