pytest-embedded 2.1.0__tar.gz → 2.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-embedded
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: A pytest plugin that designed for embedded testing.
5
5
  Author-email: Fu Hanxi <fuhanxi@espressif.com>
6
6
  Requires-Python: >=3.10
@@ -6,4 +6,4 @@ from .dut_factory import DutFactory
6
6
 
7
7
  __all__ = ['App', 'Dut', 'DutFactory']
8
8
 
9
- __version__ = '2.1.0'
9
+ __version__ = '2.1.2'
@@ -283,11 +283,51 @@ def test_expect(testdir):
283
283
  dut.expect(pattern_list, expect_all=True, timeout=1)
284
284
 
285
285
  assert e.value.value.startswith('Not found "[\'foobar\']"')
286
+
287
+ def test_expect_no_matching_list(dut): # fail
288
+ dut.write('Hello world!')
289
+ dut.write('Restarting')
290
+ dut.expect('world!', not_matching=[re.compile("Hell"), "Hello"])
291
+
292
+ def test_expect_no_matching_word(dut): # fail
293
+ dut.write('Hello world!')
294
+ dut.write('Restarting')
295
+ dut.expect('Restarting', not_matching="Hello world!")
296
+
297
+ def test_expect_no_matching_word_pass(dut):
298
+ dut.write('Hello world!')
299
+ dut.write('Restarting')
300
+ dut.expect('Restarting', not_matching="Hello world!333")
301
+
302
+ def test_expect_no_matching_word_pass_rest(dut):
303
+ dut.write('Hello world!')
304
+ dut.write('Restarting')
305
+ dut.expect('Hello world', not_matching="Restarting")
306
+
307
+ def test_expect_exact_no_matching_list(dut): # fail
308
+ dut.write('Hello world!')
309
+ dut.write('Restarting')
310
+ dut.expect_exact('world!', not_matching=["Hell1", "Hello"])
311
+
312
+ def test_expect_exact_no_matching_word(dut): # fail
313
+ dut.write('Hello world!')
314
+ dut.write('Restarting')
315
+ dut.expect_exact('Restarting', not_matching="Hello world!")
316
+
317
+ def test_expect_exact_no_matching_word_pass(dut):
318
+ dut.write('Hello world!')
319
+ dut.write('Restarting')
320
+ dut.expect_exact('Restarting', not_matching="Hello world!333")
321
+
322
+ def test_expect_exact_no_matching_word_pass_rest(dut):
323
+ dut.write('Hello world!')
324
+ dut.write('Restarting')
325
+ dut.expect_exact('Hello world', not_matching="Restarting")
286
326
  """)
287
327
 
288
328
  result = testdir.runpytest()
289
329
 
290
- result.assert_outcomes(passed=10)
330
+ result.assert_outcomes(failed=4, passed=14)
291
331
 
292
332
 
293
333
  def test_expect_from_timeout(testdir):
File without changes