mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Fix running tests in plugin using pytest
This commit is contained in:
parent
951a21ead7
commit
f8f133d2ef
5 changed files with 28 additions and 19 deletions
|
@ -1,15 +1,16 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import configparser
|
||||
import pytest
|
||||
|
||||
import configparser #To parse the resulting config files.
|
||||
import pytest #To register tests with.
|
||||
from plugins.VersionUpgrade.VersionUpgrade34to35.VersionUpgrade34to35 import VersionUpgrade34to35
|
||||
|
||||
import VersionUpgrade34to35 #The module we're testing.
|
||||
|
||||
## Creates an instance of the upgrader to test with.
|
||||
@pytest.fixture
|
||||
def upgrader():
|
||||
return VersionUpgrade34to35.VersionUpgrade34to35()
|
||||
return VersionUpgrade34to35()
|
||||
|
||||
|
||||
test_upgrade_version_nr_data = [
|
||||
("Empty config file",
|
||||
|
@ -25,6 +26,7 @@ test_upgrade_version_nr_data = [
|
|||
)
|
||||
]
|
||||
|
||||
|
||||
## Tests whether the version numbers are updated.
|
||||
@pytest.mark.parametrize("test_name, file_data", test_upgrade_version_nr_data)
|
||||
def test_upgradeVersionNr(test_name, file_data, upgrader):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue