[riot-notifications] [RIOT-OS/RIOT] tests/shell: fix flake8 errors in Python script (#15373)

Alexandre Abadie notifications at github.com
Tue Nov 3 15:59:44 CET 2020


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

This PR cleans up the Python automated test script of the `tests/phydat_dump` application: regexp string should be marked as raw string to avoid the following flake8 errors:

```
tests/sys/phydat_dump/tests/01-run.py:19:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:19:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:20:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:20:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:21:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:21:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:22:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:22:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:23:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:23:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:24:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:24:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:25:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:25:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:26:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:26:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:27:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:27:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:28:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:28:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:29:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:29:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:30:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:30:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:31:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:31:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:32:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:32:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:33:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:33:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:34:43: W605 invalid escape sequence '\^'
tests/sys/phydat_dump/tests/01-run.py:35:43: W605 invalid escape sequence '\^'
tests/sys/phydat_dump/tests/01-run.py:36:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:36:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:37:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:37:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:38:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:38:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:39:26: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:39:29: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:40:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:40:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:41:21: W605 invalid escape sequence '\['
tests/sys/phydat_dump/tests/01-run.py:41:24: W605 invalid escape sequence '\]'
tests/sys/phydat_dump/tests/01-run.py:60:45: W605 invalid escape sequence '\^'
tests/sys/phydat_dump/tests/01-run.py:61:45: W605 invalid escape sequence '\^'
```

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure

- A green CI
- `tests/phydat_dump` test is still working:

<details>

```
$ make -C tests/phydat_dump all test --no-print-directory 
Building application "tests_phydat_dump" for "native" with MCU "native".

"make" -C /work/riot/RIOT/boards/native
"make" -C /work/riot/RIOT/boards/native/drivers
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/native
"make" -C /work/riot/RIOT/cpu/native/periph
"make" -C /work/riot/RIOT/cpu/native/stdio_native
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/fmt
"make" -C /work/riot/RIOT/sys/phydat
"make" -C /work/riot/RIOT/sys/test_utils/interactive_sync
/usr/bin/ld: /work/riot/RIOT/tests/phydat_dump/bin/native/cpu/tramp.o: warning: relocation against `_native_saved_eip' in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
   text	   data	    bss	    dec	    hex	filename
  31057	    978	  47812	  79847	  137e7	/work/riot/RIOT/tests/phydat_dump/bin/native/tests_phydat_dump.elf
r
/work/riot/RIOT/tests/phydat_dump/bin/native/tests_phydat_dump.elf  
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2021.01-devel-573-g7010e3-pr/tests/phydat_dump_script_enh)
Visual phydat test application
Data:	          12.34 °C
Data:	          12.34 °F
Data:	          123.4 K
Data:	          123.4 lx
Data:	[0]        1234 m
	[1]       13456 m
	[2]      -14567 m
Data:	[0]      1234e1 m
	[1]     13456e1 m
	[2]    -14567e1 m
Data:	[0]        1234 km
	[1]       13456 km
	[2]      -14567 km
Data:	[0]       12.34 m
	[1]      134.56 m
	[2]     -145.67 m
Data:	[0]        1234 mm
	[1]       13456 mm
	[2]      -14567 mm
Data:	       -0.12345 m^2
Data:	      -12345e-6 m^3
Data:	[0]        0.12 g
	[1]        0.34 g
	[2]       56.78 g
Data:	[0]         123 mdps
	[1]         345 mdps
	[2]         678 mdps
Data:	         1234.5 G
Data:	          12345 kA
Data:	          12345 MV
Data:	        12345e7 W
Data:	         1234.5 Gs
Data:	         12.345 dBm
Data:	          12345 C
Data:	          12345 uF
Data:	       12345e-7 F
Data:	         123.45 pH
Data:	          12345 Bar
Data:	          12345 hPa
Data:	         123.45 cd
Data:	          12345 mcts
Data:	         12.345 %
Data:	         1.2345 permille
Data:	          12345 uppm
Data:	          12345 nppb
Data:	         1234.5 g/m^3
Data:	         1234.5 #/m^3
Data:	12:34:56
Data:	2020-02-27

```

</details>

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

Raised when running the static test locally in #15358

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15373

-- Commit Summary --

  * tests/shell: fix flake8 errors in Python script

-- File Changes --

    M tests/shell/tests/01-run.py (4)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15373.patch
https://github.com/RIOT-OS/RIOT/pull/15373.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15373
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201103/dd312a01/attachment.htm>


More information about the notifications mailing list