Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
Puntos extraños en la salida al imprimir una cadena de varias líneas mientras se ejecuta una prueba npm

Estoy creando una aplicación de lista de tareas pendientes y uno de los comandos en esta aplicación es imprimir la ayuda aquí está mi código:

 @app.command() def help(): y="""""Usage :-\n $ ./task add 2 hello world\t # Add a new item with priority 2 and text \"hello world\" to the list\n $ ./task ls\t # Show incomplete priority list items sorted by priority in ascending order $ ./task del INDEX\t # Delete the incomplete item with the given index\n $ ./task done INDEX\t # Mark the incomplete item with the given index as complete\n $ ./task help\t # Show usage\n $ ./task report\t # Statistics""" print(y)

Cuando ejecuto este código, obtengo el resultado normal que se puede imaginar. Pero cuando ejecuto la prueba de automatización de npm proporcionada por mi pasantía, recibo un resultado diferente.

Aquí están los resultados esperados y recibidos:

 Expected: StringContaining "Usage :- $ ./task add 2 hello world # Add a new item with priority 2 and text \"hello world\" to the list $ ./task ls # Show incomplete priority list items sorted by priority in ascending order $ ./task del INDEX # Delete the incomplete item with the given index $ ./task done INDEX # Mark the incomplete item with the given index as complete $ ./task help # Show usage $ ./task report # Statistics" Received: "Usage :-··· $ ./task add 2 hello world # Add a new item with priority 2 and text \"hello world\" to the list··· $ ./task ls # Show incomplete priority list items sorted by priority in ascending order··· $ ./task del INDEX # Delete the incomplete item with the given index··· $ ./task done INDEX # Mark the incomplete item with the given index as complete··· $ ./task help # Show usage··· $ ./task report # Statistics· "

Como puede ver, obtengo estos puntos extraños en mi salida mientras ejecuto pruebas npm. Cualquier ayuda en esto sería apreciada.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda