Skip to content

Commit ddc8dad

Browse files
committed
update testing configuration
1 parent 8f1fd8e commit ddc8dad

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

.github/workflows/python-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
python -c "import sys; print(sys.version)"
2222
python -c "import struct; print(struct.calcsize('P') * 8)"
2323
- name: Install testing dependencies
24-
run: python -m pip install --upgrade pip setuptools wheel tox tox-gh-actions pytest pytest-qt
24+
run: python -m pip install --upgrade pip setuptools wheel tox tox-gh-actions
2525
- name: Run tox tests
2626
run: python -m tox

dev-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ tox
55
black
66
flake8
77
isort
8-

tests/test_models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import pytest
2-
31
from PyQt5.QtWidgets import QTableView
42

53
from slice.models import DesignAxisModel, FontModel, FontBitFlagModel, FontNameModel

tests/test_widgets.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
import pytest
2-
31
from PyQt5.QtWidgets import QWidget, QApplication
42
from PyQt5.QtTest import QTest
53

64
from slice.ui.widgets import DragDropLineEdit
75

86

9-
# def test_drag_drop_line_edit(qtbot):
10-
# app = QApplication()
11-
# widget1 = QWidget()
12-
# widget2 = DragDropLineEdit(widget1)
13-
# qtbot.addWidget(widget1)
14-
# # placeholder text
15-
# assert (
16-
# widget2.placeholderText() == "Drop a variable font here or click the Open button"
17-
# )
18-
# assert widget2.isEnabled() is True
19-
# # accepts drops
20-
# assert widget2.acceptDrops() is True
21-
# # uses a clear button
22-
# assert widget2.isClearButtonEnabled() is True
23-
# # test text entry
24-
# assert widget2.text() == ""
25-
# QTest.keyClicks(widget2, "test")
26-
# assert widget2.text() == "test"
7+
def test_drag_drop_line_edit(qtbot):
8+
widget1 = QWidget()
9+
widget2 = DragDropLineEdit(widget1)
10+
qtbot.addWidget(widget1)
11+
qtbot.addWidget(widget2)
12+
# placeholder text
13+
assert (
14+
widget2.placeholderText() == "Drop a variable font here or click the Open button"
15+
)
16+
assert widget2.isEnabled() is True
17+
# accepts drops
18+
assert widget2.acceptDrops() is True
19+
# uses a clear button
20+
assert widget2.isClearButtonEnabled() is True
21+
# test text entry
22+
assert widget2.text() == ""
23+
QTest.keyClicks(widget2, "test")
24+
assert widget2.text() == "test"

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ envlist = py38,py39
55
commands =
66
pytest {posargs}
77
deps =
8-
-rrequirements.txt
9-
pytest
10-
pytest-qt
8+
-rdev-requirements.txt
119

1210
[gh-actions]
1311
python =

0 commit comments

Comments
 (0)