Skip to content

Commit a44f480

Browse files
Fix README and remove a test case to account for name and API change.
1 parent 803599e commit a44f480

File tree

2 files changed

+25
-47
lines changed

2 files changed

+25
-47
lines changed

README.rst

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
========
1+
=============
22
defer-imports
3-
========
3+
=============
44

55
.. image:: https://img.shields.io/github/license/Sachaa-Thanasius/defer-imports.svg
66
:alt: License: MIT
@@ -123,29 +123,29 @@ A bit rough, but there are currently two ways of measuring activation and/or imp
123123

124124
(Run once with ``__pycache__`` folders removed and ``sys.dont_write_bytecode=True``):
125125

126-
============== ======= ========== ===================
127-
Implementation Version Benchmark Time
128-
============== ======= ========== ===================
129-
CPython 3.9 regular 0.48585s (409.31x)
130-
CPython 3.9 slothy 0.00269s (2.27x)
131-
CPython 3.9 defer-imports 0.00119s (1.00x)
132-
\-\- \-\- \-\- \-\-
133-
CPython 3.10 regular 0.41860s (313.20x)
134-
CPython 3.10 slothy 0.00458s (3.43x)
135-
CPython 3.10 defer-imports 0.00134s (1.00x)
136-
\-\- \-\- \-\- \-\-
137-
CPython 3.11 regular 0.60501s (279.51x)
138-
CPython 3.11 slothy 0.00570s (2.63x)
139-
CPython 3.11 defer-imports 0.00216s (1.00x)
140-
\-\- \-\- \-\- \-\-
141-
CPython 3.12 regular 0.53233s (374.40x)
142-
CPython 3.12 slothy 0.00552s (3.88x)
143-
CPython 3.12 defer-imports 0.00142s (1.00x)
144-
\-\- \-\- \-\- \-\-
145-
CPython 3.13 regular 0.53704s (212.19x)
146-
CPython 3.13 slothy 0.00319s (1.26x)
147-
CPython 3.13 defer-imports 0.00253s (1.00x)
148-
============== ======= ========== ===================
126+
============== ======= ============= ===================
127+
Implementation Version Benchmark Time
128+
============== ======= ============= ===================
129+
CPython 3.9 regular 0.48585s (409.31x)
130+
CPython 3.9 slothy 0.00269s (2.27x)
131+
CPython 3.9 defer-imports 0.00119s (1.00x)
132+
\-\- \-\- \-\- \-\-
133+
CPython 3.10 regular 0.41860s (313.20x)
134+
CPython 3.10 slothy 0.00458s (3.43x)
135+
CPython 3.10 defer-imports 0.00134s (1.00x)
136+
\-\- \-\- \-\- \-\-
137+
CPython 3.11 regular 0.60501s (279.51x)
138+
CPython 3.11 slothy 0.00570s (2.63x)
139+
CPython 3.11 defer-imports 0.00216s (1.00x)
140+
\-\- \-\- \-\- \-\-
141+
CPython 3.12 regular 0.53233s (374.40x)
142+
CPython 3.12 slothy 0.00552s (3.88x)
143+
CPython 3.12 defer-imports 0.00142s (1.00x)
144+
\-\- \-\- \-\- \-\-
145+
CPython 3.13 regular 0.53704s (212.19x)
146+
CPython 3.13 slothy 0.00319s (1.26x)
147+
CPython 3.13 defer-imports 0.00253s (1.00x)
148+
============== ======= ============= ===================
149149

150150
- ``python -m timeit -n 1 -r 1 -- "import defer_imports"``
151151

tests/test_deferred.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -164,28 +164,6 @@ def temp_cache_module(name: str, module: ModuleType):
164164
""",
165165
id="relative import 1",
166166
),
167-
pytest.param(
168-
"""\
169-
import defer_imports
170-
171-
with defer_imports.until_use:
172-
from . import a
173-
""",
174-
"""\
175-
from defer_imports._core import DeferredImportKey as @DeferredImportKey, DeferredImportProxy as @DeferredImportProxy
176-
import defer_imports
177-
with defer_imports.until_use:
178-
@local_ns = locals()
179-
@temp_proxy = None
180-
from . import a
181-
if type(a) is @DeferredImportProxy:
182-
@temp_proxy = @local_ns.pop('a')
183-
@local_ns[@DeferredImportKey('a', @temp_proxy)] = @temp_proxy
184-
del @temp_proxy, @local_ns
185-
del @DeferredImportKey, @DeferredImportProxy
186-
""",
187-
id="with defer_imports.until_use",
188-
),
189167
],
190168
)
191169
def test_instrumentation(before: str, after: str):

0 commit comments

Comments
 (0)