I have a nose test that imports a file which runs a class with raw_inputs. Whenever I type nosetests in the command line, the prompt simply pauses and doesn’t continue – I have to keyboard interrupt to see what happens, and it turns out the nose test is running my file up to the first raw_input (one of many), at which point it simply pauses and cannot continue.
Any way to bypass this? Thanks!
If possible, rewrite the file so it won’t call raw_input() when imported.
Otherwise, if you can figure out in advance what would be acceptable input, you can take standard input from a file. Assuming input.txt contains “Pass”:
where test_input.py is:
Or you can pipe acceptable input into nosetests: