Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/data/config/lazy_module_config/test_ast_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from importlib.util import find_spec as find_module

import numpy
import numpy.compat
import numpy.fft
import numpy.linalg as linalg

from mmengine.config import Config
Expand Down
12 changes: 6 additions & 6 deletions tests/test_config/test_lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from unittest import TestCase

import numpy
import numpy.compat
import numpy.fft
import numpy.linalg as linalg
from rich.progress import Progress

Expand Down Expand Up @@ -56,17 +56,17 @@ def test_lazy_module(self):

# 1.2 getattr as LazyAttr
self.assertIsInstance(lazy_numpy.linalg, LazyAttr)
self.assertIsInstance(lazy_numpy.compat, LazyAttr)
self.assertIsInstance(lazy_numpy.fft, LazyAttr)

# 1.3 Build module from LazyObject. amp and functional can be accessed
# 1.3 Build module from LazyObject. linalg and fft can be accessed
imported_numpy = lazy_numpy.build()
self.assertIs(imported_numpy.linalg, linalg)
self.assertIs(imported_numpy.compat, numpy.compat)
self.assertIs(imported_numpy.fft, numpy.fft)

# 1.4.1 Build module from LazyAttr
imported_linalg = lazy_numpy.linalg.build()
imported_compat = lazy_numpy.compat.build()
self.assertIs(imported_compat, numpy.compat)
imported_fft = lazy_numpy.fft.build()
self.assertIs(imported_fft, numpy.fft)
self.assertIs(imported_linalg, linalg)

# 1.4.2 build class method from LazyAttr
Expand Down
Loading