mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Remove unneeded pycapsule imports
This commit is contained in:
parent
08e2687c14
commit
2d396a81c5
3 changed files with 5 additions and 14 deletions
|
@ -1,8 +1,3 @@
|
||||||
# Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import custom Sip bindings first!
|
|
||||||
import Savitar # Dont remove this line
|
|
||||||
import Arcus # No really. Don't. It needs to be there!
|
|
||||||
import pynest2d # Really!
|
|
||||||
|
|
||||||
|
|
||||||
# Ensure that the importing for all tests work
|
# Ensure that the importing for all tests work
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch, MagicMock
|
||||||
|
|
||||||
# Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import custom Sip bindings first!
|
|
||||||
import Savitar # Dont remove this line
|
|
||||||
import Arcus # No really. Don't. It needs to be there!
|
|
||||||
import pynest2d # Really!
|
|
||||||
from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used.
|
from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used.
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
|
@ -6,12 +6,7 @@
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import custom Sip bindings first!
|
|
||||||
import Savitar # Dont remove this line
|
|
||||||
import Arcus # No really. Don't. It needs to be there!
|
|
||||||
import pynest2d # Really!
|
|
||||||
from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used.
|
from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used.
|
||||||
# Even though your IDE says these files are not used, don't believe it. It's lying. They need to be there.
|
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
|
@ -19,6 +14,7 @@ from cura.Settings.MachineManager import MachineManager
|
||||||
from cura.UI.MachineActionManager import MachineActionManager
|
from cura.UI.MachineActionManager import MachineActionManager
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
|
||||||
|
|
||||||
# Create a CuraApplication object that will be shared among all tests. It needs to be initialized.
|
# Create a CuraApplication object that will be shared among all tests. It needs to be initialized.
|
||||||
# Since we need to use it more that once, we create the application the first time and use its instance afterwards.
|
# Since we need to use it more that once, we create the application the first time and use its instance afterwards.
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
|
@ -26,15 +22,18 @@ def application() -> CuraApplication:
|
||||||
app = MagicMock()
|
app = MagicMock()
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
# Returns a MachineActionManager instance.
|
# Returns a MachineActionManager instance.
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def machine_action_manager(application) -> MachineActionManager:
|
def machine_action_manager(application) -> MachineActionManager:
|
||||||
return MachineActionManager(application)
|
return MachineActionManager(application)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def global_stack():
|
def global_stack():
|
||||||
return MagicMock(name="Global Stack")
|
return MagicMock(name="Global Stack")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def container_registry(application, global_stack) -> ContainerRegistry:
|
def container_registry(application, global_stack) -> ContainerRegistry:
|
||||||
result = MagicMock()
|
result = MagicMock()
|
||||||
|
@ -42,6 +41,7 @@ def container_registry(application, global_stack) -> ContainerRegistry:
|
||||||
application.getContainerRegistry = MagicMock(return_value = result)
|
application.getContainerRegistry = MagicMock(return_value = result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def extruder_manager(application, container_registry) -> ExtruderManager:
|
def extruder_manager(application, container_registry) -> ExtruderManager:
|
||||||
if ExtruderManager.getInstance() is not None:
|
if ExtruderManager.getInstance() is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue