Repository navigation
Ensure the NRT is initialized prior to use in external NRT tests. - #7386
Conversation
As title. Also updates the docs to remind users of the NRT external API that the NRT must be initialized prior to use. Fixes numba#7385
| def setUp(self): | ||
| # initialize the NRT (in case the tests are run in isolation) | ||
| super(TestNrtExternalCFFI, self).setUp() | ||
| cpu.CPUContext(typing.Context()) |
There was a problem hiding this comment.
We should not create a new CPUContext. Better to use
from numba.core.registry import cpu_target
cpu_target.target_contextto force the initialization of the CPUContext
There was a problem hiding this comment.
Good point, I forgot this was recently changed. There's another instance of this in this test module, I'll fix that too.
| from numba.core import typing, cpu | ||
| typingctx = typing.Context() | ||
| cpu.CPUContext(typingctx, 'cpu') |
There was a problem hiding this comment.
Better not to suggest users to create a fresh CPUContext. They should get and initialize the singleton with numba.core.registry.cpu_target.target_context
As title
As title.
|
BFID: |
The build farm had to be reconfigured for this. I am re-running the build now. |
It passed! |
Great, thanks for testing it again! |
Ensure the NRT is initialized prior to use in external NRT tests.
As title. Also updates the docs to remind users of the NRT
external API that the NRT must be initialized prior to use.
Fixes #7385