Comments (4)
I'm not sure if these are needed for Sinon.PY. What do you think?
This one need further research about the behavior of SinonJS's API and the demand of asynchronous programming in Python. (To be honest, I don't have ability to reply you Yes or No now.)
The keyword of async
is available after python3.5. Previously, asynchronous programming could be implemented by gevent or coroutine in Python.
Another thing I have not considered here is thread-safe
or not.
If you are interested in Asyncio in Python, I created a package to demo that, which is copied from keynote speaker David Beazley's talk at PyCon Brazil 2015.
from sinon.
AFAIK, the interpreter of javascript, such as v8 and browser, are designed with single thread(s) + async backend is an eventLoop
However, the interpreter of python, such as Cpython and Cython, are designed in totally different way. (It...almost need one or more semesters to explain.) Thus, for implementing this feature, there are several things need to research. (Also, the reason why I didn't implement this
related function from SinonJS is same.)
from sinon.
Yes, JavaScript is 100% single-threaded, using an event loop. Python is based on C and is multi-threaded. To get an answer, I think we would need to understand why Sinon.JS has added these functions. What problem are they trying to solve?
from sinon.
Implementing #18 stub.callArg(argNum)
and stub.callArgWith(argNum, [arg1, arg2, ...])
before this.
I will provide further investigation of this issue later.
from sinon.
Related Issues (20)
- Chained onCall and withArgs doesn't work HOT 4
- Immediately creating Stub replacement is deprecated HOT 4
- onCall(...).withArgs(...) not allowed HOT 1
- Combined withArgs and onCall not working correctly
- Conditions should not persist across lines
- Precedence of onCall vs withArgs vs returns not correct HOT 1
- call count reset when using returns or throws HOT 2
- FSM Table
- Code duplication
- Get rid of target "dirty hack" HOT 2
- Cannot chain throws HOT 4
- Class-based method stub cannot execute HOT 2
- Class-based method stub cannot chain throws
- Module-based stub cannot chain throws
- Should not be able to restore an anonymous (pure) stub HOT 3
- base.py exposes protected attributes
- Calling stub.reset() makes stub no longer override return value HOT 1
- Cannot stub logging with open stream HOT 1
- Nice-to-have: stubbing constructors
- Deprecation warning due to invalid escape sequences
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sinon.