Unable to run the test

I tested my program correctly. But if I use input/output test , it fails.

Here are the error statements:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
1 Like

Welcome to the forums!

Unfortunately, we’re not able to help you without the code and the full error message, or the Repl.

1 Like

I tried creating a new project last night and this evening to have the same problem. the code runs, but when I use the test, can run it fails and doesn’t show any input or output. Even tried “exact match” and it still doesn’t work.

Simple code to print out odd indexed characters, failing tests I produced from the code itself : >

Output every other character from an input string (odd number indexed chars)

Read in a string

quote = input("Quote: ")

newChars = “”

loop through the string for the length of the string

output the odd characters

for i in range(len(quote)):
if i%2:
newChars += quote[i]

Here is the program. A very simple one.

This is the result:

My test case

It’s recommended to use f-strings in Python 3.6+.

print(f"Hi, {name}.")

Make sure to add “f” before the string or it won’t work.

If i run the program, it works. But when i use the test tool, it fails.

same here T_T
That’s should be the test tool problem…but don’t know how to fix it.

I think there’s an issue with the test tool, or maybe you’re using it wrong.

Anyway, that code works on Python, even if the test tool says it doesn’t.

I found this post might help. It said it is the problem of new template, however I clicked the link provided, it said the post is gone or private.


Folks Replit was made aware of this at the beginning of September and still hasn’t fixed it.
See post here: Help with a simple test
The current workaround is to have students copy the UNCORRUPTED .replit file to each and every new repl. They will need to open the hidden files and copy and paste in the proper UNCORRUPTED .replit file:

Here it is in case you don’t have a working copy:


# The command that runs the program. If the interpreter field is set, it will have priority and this run command will do nothing
run = ["python3", "main.py"]

entrypoint = "main.py"
# A list of globs that specify which files and directories should
# be hidden in the workspace.
hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]

# Specifies which nix channel to use when building the environment.
channel = "stable-22_11"

regex = "stderred: .+GLIBC.+not found"
message = "The command `stderred` is known to cause issues. It's recommended you remove it from your .replit configuration."

# The command to start the interpreter.
args = [
  "\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",

VIRTUAL_ENV = "/home/runner/${REPL_SLUG}/venv"
PYTHONPATH = "$PYTHONHOME/lib/python3.8:${VIRTUAL_ENV}/lib/python3.8/site-packages"
REPLIT_POETRY_PYPI_REPOSITORY = "https://package-proxy.replit.com/pypi/"
POETRY_CACHE_DIR = "${HOME}/${REPL_SLUG}/.cache/pypoetry"

# Enable unit tests. This is only supported for a few languages.
language = "python3"

# Add a debugger!
support = true

  # How to start the debugger.
  transport = "localhost:0"
  startCommand = ["dap-python", "main.py"]

    # How to communicate with the debugger.
    dapTcpAddress = "localhost:0"

    # How to tell the debugger to start a debugging session.
    command = "initialize"
    type = "request"

      adapterID = "debugpy"
      clientID = "replit"
      clientName = "replit.com"
      columnsStartAt1 = true
      linesStartAt1 = true
      locale = "en-us"
      pathFormat = "path"
      supportsInvalidatedEvent = true
      supportsProgressReporting = true
      supportsRunInTerminalRequest = true
      supportsVariablePaging = true
      supportsVariableType = true

    # How to tell the debugger to start the debuggee application.
    command = "attach"
    type = "request"

      logging = {}

# Configures the packager.
language = "python3"
ignoredPackages = ["unit_tests"]

  enabledForHosting = false
  # Enable searching packages from the sidebar.
  packageSearch = true
  # Enable guessing what packages are needed from the code.
  guessImports = true

# These are the files that need to be preserved when this
# language template is used as the base language template
# for Python repos imported from GitHub
requiredFiles = [".replit", "replit.nix", ".config", "venv"]


pattern = "**/*.py"

start = "pylsp"

run = ["sh", "-c", "python3 main.py"]

Also note, this hasn’t fixed the issue with the differences displaying properly. That is still not working and I don’t have a work around for that but at least the auto-grader has the tests passing and you can sort of figure out issues (missing or extra spaces are a pain though especially when you don’t know what line they’re on)