You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I didn't look on porting this, and currently I'm really busy with lessons and work. If you want you can take on it, I don't think it should be too dificult since PyUnit/UnitTest module is written in pure python...
Seems PyUnit since it got integrated on Python source code it was not available outside and got outdated, maybe it's better to try it with unittest2, the backport version with the upcoming changes.
And yes, I proposed also as a self-test for uPy ;-)
@piranna I think I misunderstand you.
PyUnit is the name for the python unit testing framework - which is exposed in python 3.3 as the unittest module.
docs here: http://docs.python.org/3/library/unittest.html#module-unittest
It appears in your python 3.3 source tree in lib/unittest as a pile of python files.
unittest2 is a backport of unittest for python 2.4, 2.6 but as the python is in 3.3 version - why do suggest unittest2 ?
I know I'm missing something, apologies in advance.
@piranna I think I misunderstand you.
PyUnit is the name for the python unit testing framework - which is
exposed in python 3.3 as the unittest module.
docs here: http://docs.python.org/3/library/unittest.html#module-unittest
It appears in your python 3.3 source tree in lib/unittest as a pile of
python files.
unittest2 is a backport of unittest for python 2.4, 2.6 but as the python
is in 3.3 version - why do suggest unittest2 ?
I know I'm missing something, apologies in advance.
I proposed unittest2 because I didn't know where the PyUnit/unittest code
integrated on Python source code was, but both should be equivalent if not
the same. If the integrated one is located at lib/unittest, don't doubt it
and use it since it's the official, good one.
This kind of things is why I don't understand the reason python modules are
not in an independent source tree in CPython, you can't be able to locate
and reuse them easily on other projects. Maybe we could start doing it us
on MicroPython putting the ported modules like unittest in an independent
repo (github.com/micropython/python-modules, for instance)?
I'm facing problems now. Currently uPy's import statement is very minimal. It only imports mod_name.py, no support for mod_name/__init__.py nor import mod_name.SomeClass or from mod_name import SomeClass (the last two result in failed asserts in compile.c, line 1197).
I was able to let uPy try to import mod_name/__init__.py, but am struggling with the rest. I'll propably will have to wait, until we have a more powerfull import (or use a big fat file without any imports -- but who would want that?).
Note that I'm working on import code to support sys.path. We apparently need to get decent module import support before going to support packages. But you're of course welcome to prototype how it would work - it won't appear on its own, someone who needs it will need to implement it (and my guess that MCU usage which is direct target of uPy can live happily without packages for quite some time).
What about a python testing library running on the pc using full python , controlling the board through an remote procedure call ?
This way , we'll get remote procedure call library and an ability to test python using more testing tools(for example quickcheck ) and the full power of python ?
There is now a way of doing RPC on the pyboard: you can enter raw REPL mode by using CTRL-A. This allows you to send arbitrary Python code to the board over the USB serial connection, and get the result back. I have written a small Python class that runs on the PC, which allows you to do pyboard.exec('....') and pyboard.eval('...'). I'll add it to the repo after I tidy it up.
Activity
pfalcon commentedon Jan 30, 2014
@piranna, did you try to look into porting this yet?
piranna commentedon Jan 30, 2014
Sorry, I didn't look on porting this, and currently I'm really busy with lessons and work. If you want you can take on it, I don't think it should be too dificult since PyUnit/UnitTest module is written in pure python...
msiemens commentedon Jan 30, 2014
I'd love to take a shot on this. I'm fairly new to C development but pretty fluent in Python, so I surely would learn a thing or two :)
piranna commentedon Jan 30, 2014
Please don't doubt on ask me anything :-)
dpgeorge commentedon Jan 30, 2014
If it's written in pure Python (v3) then it would be a good way to test uPy itself, to see how well (or not!) it conforms to Python.
piranna commentedon Jan 30, 2014
Seems PyUnit since it got integrated on Python source code it was not available outside and got outdated, maybe it's better to try it with unittest2, the backport version with the upcoming changes.
And yes, I proposed also as a self-test for uPy ;-)
Neon22 commentedon Feb 3, 2014
@piranna I think I misunderstand you.
PyUnit is the name for the python unit testing framework - which is exposed in python 3.3 as the unittest module.
docs here: http://docs.python.org/3/library/unittest.html#module-unittest
It appears in your python 3.3 source tree in
lib/unittestas a pile of python files.unittest2 is a backport of unittest for python 2.4, 2.6 but as the python is in 3.3 version - why do suggest unittest2 ?
I know I'm missing something, apologies in advance.
piranna commentedon Feb 3, 2014
This kind of things is why I don't understand the reason python modules are
not in an independent source tree in CPython, you can't be able to locate
and reuse them easily on other projects. Maybe we could start doing it us
on MicroPython putting the ported modules like unittest in an independent
repo (github.com/micropython/python-modules, for instance)?
msiemens commentedon Feb 4, 2014
I'm facing problems now. Currently uPy's
importstatement is very minimal. It only importsmod_name.py, no support formod_name/__init__.pynorimport mod_name.SomeClassorfrom mod_name import SomeClass(the last two result in failed asserts incompile.c, line 1197).I was able to let uPy try to import
mod_name/__init__.py, but am struggling with the rest. I'll propably will have to wait, until we have a more powerfullimport(or use a big fat file without any imports -- but who would want that?).pfalcon commentedon Feb 4, 2014
Note that I'm working on import code to support sys.path. We apparently need to get decent module import support before going to support packages. But you're of course welcome to prototype how it would work - it won't appear on its own, someone who needs it will need to implement it (and my guess that MCU usage which is direct target of uPy can live happily without packages for quite some time).
probar commentedon Mar 16, 2014
What about a python testing library running on the pc using full python , controlling the board through an remote procedure call ?
This way , we'll get remote procedure call library and an ability to test python using more testing tools(for example quickcheck ) and the full power of python ?
dpgeorge commentedon Mar 20, 2014
There is now a way of doing RPC on the pyboard: you can enter raw REPL mode by using CTRL-A. This allows you to send arbitrary Python code to the board over the USB serial connection, and get the result back. I have written a small Python class that runs on the PC, which allows you to do pyboard.exec('....') and pyboard.eval('...'). I'll add it to the repo after I tidy it up.
dhylands commentedon Mar 21, 2014
Sweet
pfalcon commentedon Mar 26, 2014
I just pushed getattr() implementation, which was another missing piece to implement this stuff.
dpgeorge commentedon Mar 26, 2014
RPC on the pyboard now exists as tools/pyboard.py
8 remaining items
py/nlrthumb: Make non-Thumb2 long-jump workaround opt-in.
py/nlrthumb: Make non-Thumb2 long-jump workaround opt-in.
py/nlrthumb: Make non-Thumb2 long-jump workaround opt-in.
ESP32_GENERIC_S3: raise INT_WDT timeout 300->1000ms (fluispotter micr…
ESP32_GENERIC_S3: pin brownout detector ON (level 7) explicitly (flui…
Merge pull request #1 from fluispotter/fluispotter-int-wdt-1000ms
ESP32_GENERIC_S3: raise INT_WDT timeout 300->1000ms on v1.25.0 base (…
py/nlrthumb: Make non-Thumb2 long-jump workaround opt-in.