pytest-embedded-serial 1.8.0__tar.gz → 1.8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/PKG-INFO +2 -2
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/pyproject.toml +35 -21
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/pytest_embedded_serial/__init__.py +1 -1
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/pytest_embedded_serial/serial.py +5 -5
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/tests/test_serial.py +0 -60
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/LICENSE +0 -0
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/README.md +0 -0
- {pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/pytest_embedded_serial/dut.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pytest-embedded-serial
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: Make pytest-embedded plugin work with Serial.
|
|
5
5
|
Author-email: Fu Hanxi <fuhanxi@espressif.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
21
|
Classifier: Programming Language :: Python
|
|
22
22
|
Classifier: Topic :: Software Development :: Testing
|
|
23
|
-
Requires-Dist: pytest-embedded~=1.8.
|
|
23
|
+
Requires-Dist: pytest-embedded~=1.8.2
|
|
24
24
|
Requires-Dist: pyserial~=3.0
|
|
25
25
|
Project-URL: changelog, https://github.com/espressif/pytest-embedded/blob/main/CHANGELOG.md
|
|
26
26
|
Project-URL: documentation, https://docs.espressif.com/projects/pytest-embedded/en/latest/
|
|
@@ -30,7 +30,7 @@ dynamic = ["version", "description"]
|
|
|
30
30
|
requires-python = ">=3.7"
|
|
31
31
|
|
|
32
32
|
dependencies = [
|
|
33
|
-
"pytest-embedded~=1.8.
|
|
33
|
+
"pytest-embedded~=1.8.2",
|
|
34
34
|
"pyserial~=3.0",
|
|
35
35
|
]
|
|
36
36
|
|
|
@@ -43,36 +43,38 @@ changelog = "https://github.com/espressif/pytest-embedded/blob/main/CHANGELOG.md
|
|
|
43
43
|
[tool.isort]
|
|
44
44
|
profile = 'black'
|
|
45
45
|
|
|
46
|
-
[tool.
|
|
46
|
+
[tool.ruff]
|
|
47
47
|
line-length = 120
|
|
48
|
-
target-version =
|
|
49
|
-
force-exclude = '/tests/'
|
|
50
|
-
skip-string-normalization = true
|
|
48
|
+
target-version = "py37"
|
|
51
49
|
|
|
52
|
-
[tool.ruff]
|
|
50
|
+
[tool.ruff.lint]
|
|
53
51
|
select = [
|
|
54
52
|
'F', # Pyflakes
|
|
55
53
|
'E', # pycodestyle
|
|
56
54
|
'W', # pycodestyle
|
|
57
55
|
# 'C90', # mccabe
|
|
58
|
-
|
|
56
|
+
'I', # isort
|
|
59
57
|
# 'N', # pep8-naming
|
|
60
58
|
# 'D', # pydocstyle
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
'UP', # pyupgrade
|
|
60
|
+
'YTT', # flake8-2020
|
|
63
61
|
# 'ANN', # flake8-annotations
|
|
62
|
+
# 'ASYNC', # flake8-async
|
|
63
|
+
# 'TRIO', # flake8-trio
|
|
64
64
|
# 'S', # flake8-bandit
|
|
65
65
|
# 'BLE', # flake8-blind-except
|
|
66
66
|
# 'FBT', # flake8-boolean-trap
|
|
67
67
|
# 'B', # flake8-bugbear
|
|
68
|
-
|
|
68
|
+
'A', # flake8-builtins
|
|
69
69
|
# 'COM', # flake8-commas
|
|
70
|
-
# '
|
|
70
|
+
# 'CPY', # flake8-copyright
|
|
71
|
+
# 'C4', # flake8-comprehensions
|
|
71
72
|
# 'DTZ', # flake8-datetimez
|
|
72
73
|
# 'T10', # flake8-debugger
|
|
73
|
-
# 'DJ', #
|
|
74
|
-
# 'EM', #
|
|
74
|
+
# 'DJ', # flake8-django
|
|
75
|
+
# 'EM', # flake8-errmsg
|
|
75
76
|
# 'EXE', # flake8-executable
|
|
77
|
+
# 'FA', # flake8-future-annotations
|
|
76
78
|
# 'ISC', # flake8-implicit-str-concat
|
|
77
79
|
# 'ICN', # flake8-import-conventions
|
|
78
80
|
# 'G', # flake8-logging-format
|
|
@@ -80,23 +82,35 @@ select = [
|
|
|
80
82
|
# 'PIE', # flake8-pie
|
|
81
83
|
# 'T20', # flake8-print
|
|
82
84
|
# 'PYI', # flake8-pyi
|
|
83
|
-
# 'PT', #
|
|
85
|
+
# 'PT', # flake8-pytest-style
|
|
84
86
|
# 'Q', # flake8-quotes
|
|
85
87
|
# 'RSE', # flake8-raise
|
|
86
88
|
# 'RET', # flake8-return
|
|
87
89
|
# 'SLF', # flake8-self
|
|
90
|
+
# 'SLOT', # flake8-slots
|
|
88
91
|
# 'SIM', # flake8-simplify
|
|
89
92
|
# 'TID', # flake8-tidy-imports
|
|
90
93
|
# 'TCH', # flake8-type-checking
|
|
91
|
-
# '
|
|
94
|
+
# 'INT', # flake8-gettext
|
|
95
|
+
'ARG', # flake8-unused-arguments
|
|
92
96
|
# 'PTH', # flake8-use-pathlib
|
|
93
|
-
# '
|
|
94
|
-
# '
|
|
97
|
+
# 'TD', # flake8-todos
|
|
98
|
+
# 'FIX', # flake8-fixme
|
|
99
|
+
'ERA', # eradicate
|
|
100
|
+
# 'PD', # pandas-vet
|
|
95
101
|
# 'PGH', # pygrep-hooks
|
|
96
|
-
# 'PL', #
|
|
102
|
+
# 'PL', # Pylint
|
|
97
103
|
# 'TRY', # tryceratops
|
|
104
|
+
# 'FLY', # flynt
|
|
98
105
|
# 'NPY', # NumPy-specific rules
|
|
99
|
-
# '
|
|
106
|
+
# 'AIR', # Airflow
|
|
107
|
+
# 'PERF', # Perflint
|
|
108
|
+
# 'FURB', # refurb
|
|
109
|
+
'LOG', # flake8-logging
|
|
110
|
+
'RUF', # Ruff-specific rules
|
|
100
111
|
]
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
|
|
113
|
+
[tool.ruff.format]
|
|
114
|
+
quote-style = "single"
|
|
115
|
+
exclude = ["**/tests/*"]
|
|
116
|
+
docstring-code-format = true
|
{pytest_embedded_serial-1.8.0 → pytest_embedded_serial-1.8.2}/pytest_embedded_serial/serial.py
RENAMED
|
@@ -5,7 +5,7 @@ import multiprocessing
|
|
|
5
5
|
import queue
|
|
6
6
|
import threading
|
|
7
7
|
import time
|
|
8
|
-
from typing import Dict, Optional
|
|
8
|
+
from typing import Any, ClassVar, Dict, Optional
|
|
9
9
|
|
|
10
10
|
import serial as pyserial
|
|
11
11
|
from pytest_embedded.log import MessageQueue
|
|
@@ -28,7 +28,7 @@ class Serial:
|
|
|
28
28
|
|
|
29
29
|
DEFAULT_BAUDRATE = 115200
|
|
30
30
|
|
|
31
|
-
DEFAULT_PORT_CONFIG = {
|
|
31
|
+
DEFAULT_PORT_CONFIG: ClassVar[Dict[str, Any]] = {
|
|
32
32
|
'baudrate': DEFAULT_BAUDRATE,
|
|
33
33
|
'bytesize': pyserial.EIGHTBITS,
|
|
34
34
|
'parity': pyserial.PARITY_NONE,
|
|
@@ -38,13 +38,13 @@ class Serial:
|
|
|
38
38
|
'rtscts': False,
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
occupied_ports: Dict[str, None] = dict()
|
|
41
|
+
occupied_ports: ClassVar[Dict[str, None]] = dict()
|
|
42
42
|
|
|
43
43
|
def __init__(
|
|
44
44
|
self,
|
|
45
45
|
msg_queue: MessageQueue,
|
|
46
|
-
port: str = None,
|
|
47
|
-
port_location: str = None,
|
|
46
|
+
port: Optional[str] = None,
|
|
47
|
+
port_location: Optional[str] = None,
|
|
48
48
|
baud: int = DEFAULT_BAUDRATE,
|
|
49
49
|
meta: Optional[Meta] = None,
|
|
50
50
|
**kwargs,
|
|
@@ -51,63 +51,3 @@ def test_teardown_called_for_multi_dut(testdir):
|
|
|
51
51
|
|
|
52
52
|
result = testdir.runpytest()
|
|
53
53
|
result.assert_outcomes(passed=1, errors=1)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# def test_serial_file_description_leak(testdir):
|
|
57
|
-
# testdir.makepyfile(r"""
|
|
58
|
-
# import pytest
|
|
59
|
-
# from pytest_lazyfixture import lazy_fixture
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
-
# dutHelper = None
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
# class DutHelper:
|
|
66
|
-
# def __init__(self):
|
|
67
|
-
# self.duts = None
|
|
68
|
-
#
|
|
69
|
-
# def setDut(self, duts):
|
|
70
|
-
# self.duts = duts
|
|
71
|
-
#
|
|
72
|
-
# def dut1(self):
|
|
73
|
-
# return self.duts[0]
|
|
74
|
-
#
|
|
75
|
-
# def dut2(self):
|
|
76
|
-
# return self.duts[1]
|
|
77
|
-
#
|
|
78
|
-
#
|
|
79
|
-
# @pytest.fixture
|
|
80
|
-
# def dut_helper(dut):
|
|
81
|
-
# global dutHelper
|
|
82
|
-
# if dutHelper is None:
|
|
83
|
-
# dutHelper = DutHelper()
|
|
84
|
-
# dutHelper.setDut(dut)
|
|
85
|
-
# return dutHelper
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
# @pytest.fixture
|
|
89
|
-
# def DUT1(dut_helper):
|
|
90
|
-
# return dut_helper.dut1()
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
# @pytest.fixture
|
|
94
|
-
# def DUT2(dut_helper):
|
|
95
|
-
# return dut_helper.dut2()
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
# @pytest.mark.parametrize("fixture", [lazy_fixture("DUT1"), lazy_fixture("DUT2")])
|
|
99
|
-
# @pytest.mark.parametrize("test_input", range(0, 300))
|
|
100
|
-
# def test_dummy(test_input, dut, fixture):
|
|
101
|
-
# dut[0].write("foo")
|
|
102
|
-
# assert test_input == test_input
|
|
103
|
-
#
|
|
104
|
-
# """)
|
|
105
|
-
#
|
|
106
|
-
# result = testdir.runpytest(
|
|
107
|
-
# '-s',
|
|
108
|
-
# '--count', 2,
|
|
109
|
-
# '--embedded-services', 'serial|serial',
|
|
110
|
-
# '--port', '/dev/ttyUSB0|/dev/ttyUSB1',
|
|
111
|
-
# '--baud', '115200|115200'
|
|
112
|
-
# )
|
|
113
|
-
# result.assert_outcomes(passed=600)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|