printing pc/sc reader device number in tester is non-determinstic
pySim-read + pySim-prog print
Using PC/SC reader (dev=5) interfacet
during normal operation. dev=5 is the PC/SC reader number, which is non-deterministic and messes up the *.ok test results.
I think we need to address this separately. The message should not be printed at all during the tests. The PC/SC device numbers are not stable over time (think of USB enumeration order, hotplug order, ...) so they are not reproducible and shouldn't be printed.So either
- we don't print the number at all anymore (works for me), or
- we add a command line argument like
#1 Updated by fixeria about 2 months ago
we don't print the number at all anymore (works for me), or
we add a command line argument like --deterministic-output
I am not against getting rid of this print, but it sounds like we're removing features just because our unit tests are not flexible enough... One problem is that we relay on lazy stderr / stdout matching, and there is always the risk that something gets printed (e.g. by Python itself) and everything gets broken. Ideally we should use generic Python's unittest framework instead. Another problem is that we use print() everywhere instead of generic Python's logging framework. If we were, we could just change the log level of this message.
P.S. This is just my opinion. I might invest my time into this some day.
#2 Updated by laforge about 2 months ago
On Sun, Apr 19, 2020 at 12:17:50PM +0000, fixeria [REDMINE] wrote:
I am not against getting rid of this print, but it sounds like we're removing features just because our unit tests are not flexible enough...
The "Feature" consists in echoing back the number which the user gave on the command line. I wouldn't
consider that an important feature at all. Either the user explicitly specified that very number,
or the default (0) is used.
So I agree we shouldn't remove real features just for our lack of test flexibility.