Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esptool/test/test_espefuse.py: import StringIO (ESPTOOL-328) #677

Closed
cederom opened this issue Oct 17, 2021 · 4 comments
Closed

esptool/test/test_espefuse.py: import StringIO (ESPTOOL-328) #677

cederom opened this issue Oct 17, 2021 · 4 comments

Comments

@cederom
Copy link

cederom commented Oct 17, 2021

  • Operating system: FreeBSD 13.0-STABLE
  • Python version: 3.8.12

Full esptool.py command line as run:

esptool.py v3.1
3.1

Full output from esptool.py

root@0xCFMX4:/usr/ports/comms/py-esptool # make do-test
========================================= test session starts =========================================
platform freebsd13 -- Python 3.8.12, pytest-4.6.11, py-1.9.0, pluggy-0.13.1
rootdir: /tmp/ports-build/usr/ports/comms/py-esptool/work-py38/esptool-3.1
collected 79 items / 1 errors / 78 selected

=============================================== ERRORS ================================================
_______________________________ ERROR collecting test/test_espefuse.py ________________________________
ImportError while importing test module '/tmp/ports-build/usr/ports/comms/py-esptool/work-py38/esptool-3.1/test/test_espefuse.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/test_espefuse.py:17: in <module>
    import StringIO
E   ModuleNotFoundError: No module named 'StringIO'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================= 1 error in 0.84 seconds =======================================
*** Error code 2

Stop.
make: stopped in /usr/ports/comms/py-esptool

What is the expected behaviour?

Test passes.

Do you have any other information from investigating this?

from io import StringIO ? :-)

Is there any other information you can think of which will help us reproduce this problem?

from io import StringIO ? :-)

@cederom cederom added the bug label Oct 17, 2021
@github-actions github-actions bot changed the title esptool/test/test_espefuse.py: import StringIO esptool/test/test_espefuse.py: import StringIO (ESPTOOL-328) Oct 17, 2021
@dobairoland
Copy link
Collaborator

Hi @cederom. Thanks. You are right that this import is Python 2 only. We will fix it.

I just wanted to make sure that you've read the header of the file that this script is destructive and shouldn't be run on ESP chips. There is another file (test_espefuse_host.py) which can be run virtually (without any connected chip).

@cederom
Copy link
Author

cederom commented Oct 19, 2021

Thanks @dobairoland :-)

If the test is destructive should not be optional with warning?? :-)

How exactly is it destructive? Cannot be rolled back?

@dobairoland
Copy link
Collaborator

dobairoland commented Oct 19, 2021

@cederom This is the warning in the beginning of the script:

# IMPORTANT These are not designed to be run on a real ESP32 chip.
#
# If you force them to run on a real chip, you will corrupt
# the chip's efuses on the first run and not get any useful
# test results either.

efuses can be burned only once and the operation cannot be undone. They change the chip functionality. These tests would probably make the chip completely useless.

If the test is destructive should not be optional with warning?? :-)

What made you think you need to run these tests?

@cederom
Copy link
Author

cederom commented Oct 19, 2021

I was updating FreeBSD Port of esptool, there was a target named do-tests, so I did thinking it would test the functionalities of the package ;-)

Please prompt clear warning before those tests that they are destructive should not be used on real hardware and abort by default.

If only one test failed and others were destructive then I have just crippled my brand new ESP32-C3-DevKitM/C :-(

I have some spare ESP32-C3 WROOM and MINI modules I may be able to resolder them..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants