Input/output Tests, empty output every time

So I have a Input/Output Tests set up for some input and match exact to some output (which would be the print statement)

My code is just,

import time

inp = input()
print(inp)
time.sleep(100)
quit()

When I am testing against any input or output its always empty nothing is printed, and it also doesn’t wait for 100 seconds, it just fails in a few seconds.

What could be causing this issue?

Hi @ArshKhan14 , welcome to the forums!
Did you rename your main.py file to something else?

1 Like

Hi @ArshKhan14 !
Could you send the link to your repl?
Thanks!

the reason is because of the sleep. The test has to wait for the code to finish so you’re telling it to wait 100 seconds before it finishes.

correct code is:

inp = input()
print(inp)
2 Likes

try doing this:

import time
print(input(), flush=True)
time.sleep(100)

I think the problem might be that you haven’t forced the console to output anything & quitting may make it so it just terminates idk

2 Likes

I have added the sleep just for testing my actual code was a bit lengthy and taking quite a few seconds to complete so the test would just fail, so to replicate the error I just used sleep.

This works but the sleep is ignored and the test finishes, I want it to wait for entire code.

1 Like

Here, repl does this work?

I’ve forked the code, and it seems to be working fine for me. time.sleep is working fine and the program quits after 100 seconds…

What about the input/output tests? Are those working?

Yup. They’re working perfectly fine.

Why won’t it work on mine? Could it be because I am using the like the free version?