mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
Revert "Fix running tests in plugin using pytest"
This reverts commit f8f133d2ef
.
This commit is contained in:
parent
d65114bd56
commit
9d8583a3b6
5 changed files with 19 additions and 28 deletions
|
@ -1,7 +1,8 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import configparser # An input for some functions we're testing.
|
import configparser # An input for some functions we're testing.
|
||||||
import os # To find the integration test .ini files.
|
import os.path # To find the integration test .ini files.
|
||||||
import pytest # To register tests with.
|
import pytest # To register tests with.
|
||||||
import unittest.mock # To mock the application, plug-in and container registry out.
|
import unittest.mock # To mock the application, plug-in and container registry out.
|
||||||
|
|
||||||
|
@ -10,15 +11,13 @@ import UM.PluginRegistry # To mock the plug-in registry out.
|
||||||
import UM.Settings.ContainerRegistry # To mock the container registry out.
|
import UM.Settings.ContainerRegistry # To mock the container registry out.
|
||||||
import UM.Settings.InstanceContainer # To intercept the serialised data from the read() function.
|
import UM.Settings.InstanceContainer # To intercept the serialised data from the read() function.
|
||||||
|
|
||||||
import plugins.LegacyProfileReader.LegacyProfileReader as LegacyProfileReaderModule
|
import LegacyProfileReader as LegacyProfileReaderModule # To get the directory of the module.
|
||||||
from plugins.LegacyProfileReader.LegacyProfileReader import LegacyProfileReader
|
from LegacyProfileReader import LegacyProfileReader # The module we're testing.
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def legacy_profile_reader():
|
def legacy_profile_reader():
|
||||||
return LegacyProfileReader()
|
return LegacyProfileReader()
|
||||||
|
|
||||||
|
|
||||||
test_prepareDefaultsData = [
|
test_prepareDefaultsData = [
|
||||||
{
|
{
|
||||||
"defaults":
|
"defaults":
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import configparser
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from plugins.VersionUpgrade.VersionUpgrade25to26 import VersionUpgrade25to26
|
import configparser #To check whether the appropriate exceptions are raised.
|
||||||
|
import pytest #To register tests with.
|
||||||
|
|
||||||
|
import VersionUpgrade25to26 #The module we're testing.
|
||||||
|
|
||||||
## Creates an instance of the upgrader to test with.
|
## Creates an instance of the upgrader to test with.
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upgrader():
|
def upgrader():
|
||||||
return VersionUpgrade25to26.VersionUpgrade25to26()
|
return VersionUpgrade25to26.VersionUpgrade25to26()
|
||||||
|
|
||||||
|
|
||||||
test_cfg_version_good_data = [
|
test_cfg_version_good_data = [
|
||||||
{
|
{
|
||||||
"test_name": "Simple",
|
"test_name": "Simple",
|
||||||
|
@ -61,7 +60,6 @@ setting_version = -3
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## Tests the technique that gets the version number from CFG files.
|
## Tests the technique that gets the version number from CFG files.
|
||||||
#
|
#
|
||||||
# \param data The parametrised data to test with. It contains a test name
|
# \param data The parametrised data to test with. It contains a test name
|
||||||
|
@ -118,7 +116,6 @@ version = 1.2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## Tests whether getting a version number from bad CFG files gives an
|
## Tests whether getting a version number from bad CFG files gives an
|
||||||
# exception.
|
# exception.
|
||||||
#
|
#
|
||||||
|
@ -158,7 +155,6 @@ foo = bar
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## Tests whether the settings that should be removed are removed for the 2.6
|
## Tests whether the settings that should be removed are removed for the 2.6
|
||||||
# version of preferences.
|
# version of preferences.
|
||||||
@pytest.mark.parametrize("data", test_upgrade_preferences_removed_settings_data)
|
@pytest.mark.parametrize("data", test_upgrade_preferences_removed_settings_data)
|
||||||
|
@ -204,7 +200,6 @@ type = instance_container
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## Tests whether the settings that should be removed are removed for the 2.6
|
## Tests whether the settings that should be removed are removed for the 2.6
|
||||||
# version of instance containers.
|
# version of instance containers.
|
||||||
@pytest.mark.parametrize("data", test_upgrade_instance_container_removed_settings_data)
|
@pytest.mark.parametrize("data", test_upgrade_instance_container_removed_settings_data)
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import configparser
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from plugins.VersionUpgrade.VersionUpgrade26to27.VersionUpgrade26to27 import VersionUpgrade26to27
|
import configparser #To check whether the appropriate exceptions are raised.
|
||||||
|
import pytest #To register tests with.
|
||||||
|
|
||||||
|
import VersionUpgrade26to27 #The module we're testing.
|
||||||
|
|
||||||
## Creates an instance of the upgrader to test with.
|
## Creates an instance of the upgrader to test with.
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upgrader():
|
def upgrader():
|
||||||
return VersionUpgrade26to27()
|
return VersionUpgrade26to27.VersionUpgrade26to27()
|
||||||
|
|
||||||
|
|
||||||
test_cfg_version_good_data = [
|
test_cfg_version_good_data = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import configparser
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from plugins.VersionUpgrade.VersionUpgrade27to30.VersionUpgrade27to30 import VersionUpgrade27to30
|
import configparser #To parse the resulting config files.
|
||||||
|
import pytest #To register tests with.
|
||||||
|
|
||||||
|
import VersionUpgrade27to30 #The module we're testing.
|
||||||
|
|
||||||
## Creates an instance of the upgrader to test with.
|
## Creates an instance of the upgrader to test with.
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upgrader():
|
def upgrader():
|
||||||
return VersionUpgrade27to30()
|
return VersionUpgrade27to30.VersionUpgrade27to30()
|
||||||
|
|
||||||
test_cfg_version_good_data = [
|
test_cfg_version_good_data = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import configparser
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from plugins.VersionUpgrade.VersionUpgrade34to35.VersionUpgrade34to35 import VersionUpgrade34to35
|
import configparser #To parse the resulting config files.
|
||||||
|
import pytest #To register tests with.
|
||||||
|
|
||||||
|
import VersionUpgrade34to35 #The module we're testing.
|
||||||
|
|
||||||
## Creates an instance of the upgrader to test with.
|
## Creates an instance of the upgrader to test with.
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upgrader():
|
def upgrader():
|
||||||
return VersionUpgrade34to35()
|
return VersionUpgrade34to35.VersionUpgrade34to35()
|
||||||
|
|
||||||
|
|
||||||
test_upgrade_version_nr_data = [
|
test_upgrade_version_nr_data = [
|
||||||
("Empty config file",
|
("Empty config file",
|
||||||
|
@ -26,7 +25,6 @@ test_upgrade_version_nr_data = [
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## Tests whether the version numbers are updated.
|
## Tests whether the version numbers are updated.
|
||||||
@pytest.mark.parametrize("test_name, file_data", test_upgrade_version_nr_data)
|
@pytest.mark.parametrize("test_name, file_data", test_upgrade_version_nr_data)
|
||||||
def test_upgradeVersionNr(test_name, file_data, upgrader):
|
def test_upgradeVersionNr(test_name, file_data, upgrader):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue