2

When I run the example feature shown on the pypi behave page the output isn't quite as I'd hoped: The Given, When and Then output messages are printed once in grey, once in colour. Also strange characters are printed at the start of each coloured line.

screenshot:
http://imgur.com/i2VoF

When I run a feature that uses Selenium, in addition to the above I get the message: No handlers could be found for logger "selenium.webdriver.remote.remote_connection"

Any thoughts welcome

Alex L
  • 8,748
  • 5
  • 49
  • 75
mr_c
  • 593
  • 3
  • 12
  • What OS? What console/IDE are you using? Python commandline or IDLE? Can you upload a screenshot to a 3rd party image hosting site (ie http://imgur.com/), and provide a link? – Alex L May 16 '12 at 14:43
  • 1
    whoops, sorry, Ubuntu 10.04, GNOME terminal 2.30.2, Python commandline, http://imgur.com/i2VoF – mr_c May 16 '12 at 14:56
  • try this tutorial it will help you http://www.blog.fruiapps.com/2012/11/Behavior-Driven-Development-in-Python-with-Lettuce – whatf Nov 30 '12 at 15:00

1 Answers1

1

Looks like it's trying to colour the output, but something isn't working (or enabled?). Try running python -m behave -c

From configuration.py: (describing the -c flag)

(('-c', '--no-color'), dict(action='store_false', dest='color',
     help="Disable the use of ANSI color escapes.")),

Screenshot:

screenshot without colouring

If you'd like colouring to work, I suggest reading Print in terminal with colors using Python?

You could try modifying the \behave\formatter\ansi_escapes.py file with the correct ANSI escapes for your terminal - try using the list of escapes on http://pypi.python.org/pypi/colorama

Community
  • 1
  • 1
Alex L
  • 8,748
  • 5
  • 49
  • 75