mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Use fastConfigParser for the versionUpToDate test
This makes the test a fair bit faster!
This commit is contained in:
parent
f31490125c
commit
bfef61ad81
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@ import os
|
||||||
import os.path
|
import os.path
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from UM.FastConfigParser import FastConfigParser
|
||||||
from cura.CuraApplication import CuraApplication # To compare against the current SettingVersion.
|
from cura.CuraApplication import CuraApplication # To compare against the current SettingVersion.
|
||||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||||
from UM.Settings.InstanceContainer import InstanceContainer
|
from UM.Settings.InstanceContainer import InstanceContainer
|
||||||
|
@ -47,6 +48,7 @@ def collectAllVariants():
|
||||||
result.append(os.path.join(root, filename))
|
result.append(os.path.join(root, filename))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def collectAllIntents():
|
def collectAllIntents():
|
||||||
result = []
|
result = []
|
||||||
for root, directories, filenames in os.walk(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "intent"))):
|
for root, directories, filenames in os.walk(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "intent"))):
|
||||||
|
@ -169,8 +171,7 @@ def test_validateVariantProfiles(file_name):
|
||||||
def test_versionUpToDate(file_name):
|
def test_versionUpToDate(file_name):
|
||||||
try:
|
try:
|
||||||
with open(file_name, encoding = "utf-8") as data:
|
with open(file_name, encoding = "utf-8") as data:
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = FastConfigParser(data.read())
|
||||||
parser.read(file_name)
|
|
||||||
|
|
||||||
assert "general" in parser
|
assert "general" in parser
|
||||||
assert "version" in parser["general"]
|
assert "version" in parser["general"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue