Closed famish99 closed 9 years ago
Can you provide some arguments for this commit. I think the current behavior is the correct one. If nothing is read, it should try the loop again (continue
) without going through the whole loop.
It will not time out because "now" is not being reread. On Mar 26, 2015 8:30 PM, "Hernan Grecco" notifications@github.com wrote:
Can you provide some arguments for this commit. I think the current behavior is the correct one. If nothing is read, it should try the loop again (continue) without going through the whole loop.
— Reply to this email directly or view it on GitHub https://github.com/hgrecco/pyvisa-sim/pull/23#issuecomment-86784610.
You could avoid the variable altogether to continue to use the continue, I can make the change later, just didn't occur to me at the time On Mar 26, 2015 9:34 PM, "Huan Nguyen" famish99@gmail.com wrote:
It will not time out because "now" is not being reread. On Mar 26, 2015 8:30 PM, "Hernan Grecco" notifications@github.com wrote:
Can you provide some arguments for this commit. I think the current behavior is the correct one. If nothing is read, it should try the loop again (continue) without going through the whole loop.
— Reply to this email directly or view it on GitHub https://github.com/hgrecco/pyvisa-sim/pull/23#issuecomment-86784610.
You are right, now = ...
ended up in the wrong place. But I don't like the idea of flowing through the whole while
. I think the right way would be to remove that variable and just do time.time() - start
in the while condition.
Another question: You also added a test with unexpected read
. There is no such thing as that error. reading when there is nothing to read yields a timeout.
Yeah it should expect an exception. It's just what I call the test to know where it failed. On Mar 27, 2015 6:56 AM, "Hernan Grecco" notifications@github.com wrote:
You are right, now = ... ended up in the wrong place. But I don't like the idea of flowing through the whole while. I think the right way would be to remove that variable and just do time.time() - start in the while condition.
Another question: You also added a test with unexpected read. There is no such thing as that error. reading when there is nothing to read yields a timeout.
— Reply to this email directly or view it on GitHub https://github.com/hgrecco/pyvisa-sim/pull/23#issuecomment-86912765.
I will update the fix when I get to work, just want to make sure it passes all my tests before checking it in. On Mar 27, 2015 6:56 AM, "Hernan Grecco" notifications@github.com wrote:
You are right, now = ... ended up in the wrong place. But I don't like the idea of flowing through the whole while. I think the right way would be to remove that variable and just do time.time() - start in the while condition.
Another question: You also added a test with unexpected read. There is no such thing as that error. reading when there is nothing to read yields a timeout.
— Reply to this email directly or view it on GitHub https://github.com/hgrecco/pyvisa-sim/pull/23#issuecomment-86912765.
Great!
Regarding the "unexpected read" test, I'd be preferred if it was left in but maybe renamed to "Read empty buffer" because my internal unit tests require the behavior.
Perhaps somewhere in the resource initialization, the timeout can be shorted to improve test time, but otherwise I'd rather keep the test in to ensure it won't break again in the future.
Sorry if I was unclear. It is fine to keep the test and is also fine that we raise a VisaIOError(constants.VI_ERROR_TMO)
. What I do not want is to diverge from pyvisa.
Yeah, I think the test is consistent with pyvisa, but the naming sense is probably off because I just copied it from my internal unit tests.
Do you want to merge this pull request before I add another bugfix or should I combine it with this pull request?
I will merge them on friday. Thanks!
Is this even merge-able anymore?
This should be a pretty minor pull request.
Fixed unexpected read timeout behavior. Fixed loading of config files that aren't the default config.