python - Django Lettuce Running Tests Twice in Parallel -
python - Django Lettuce Running Tests Twice in Parallel -
i'm trying output step definitions lettuce. when run test, see flash output second, before beingness overwritten appears same tests. can see steps beingness called twice in output. 1 dark (almost black) colored, time it's greenish or red. output highlighted below.
this causing me headache because debugging info showing in other test thats running, not one. i'm having hard time articulating this, think screen capture helps illustrate point: should see each step called once, isn't case right now.
any help appreciated.
feature
feature: navigation persion looking info on specific machine in order view date machine inventory should able navigate individual machine background: given next users exist: | username | first_name | last_name | password | | johndoe | john | doe | testpass | , next machines exist: | msnbr | machine_name | brand_name | brand_slug | partition | product_group | machine_type | cost | model | location | | 111111 | router | altendorf | altendorf | | | | 100 | model7 | zenith | | 222222 | cnc router | belfab | belfab | | | | 200 | model6 | echo | | 333333 | saw | durst | durst | | | | 300 | model5 | xalpha | | 444444 | router | belfab | belfab | | | | 250 | model4 | beta | | 555555 | eh router | belfab | belfab | | | | 250 | model4 | water | | 666666 | router 6 | belfab | belfab | | | | 250 | model2 | river | | 777777 | router 8 | belfab | belfab | | | | 250 | model1 | snake | , logged in "johndoe" password "testpass" scenario: executive, can see brands given see "brand" should see "altendorf" , should see "belfab" , should see "durst" click "logout" scenario: executive, can navigate brands given see "brand" when click "belfab" should see "5" machines , machines should in next order: | model | | model2 | | model4 | | model5 | | model6 | | model7 | steps (formatting bit off)
from lettuce import step, world lettuce_webdriver.util import assert_true django.contrib.auth.models import user website.factories import * website.models import * @step(u'the next machines exist:') def the_following_machines_exist(step): machine_hash in step.hashes: brand, created = brand.objects.get_or_create( name=machine_hash['brand_name'], slug=machine_hash['brand_slug'] ) division, created = division.objects.get_or_create( name=machine_hash['division'] ) product_group, created = productgroup.objects.get_or_create( name=machine_hash['product_group'] ) machine_type, created = machinetype.objects.get_or_create( name=machine_hash['machine_type'] ) machine = machine( machine_year = "2000", hold_for = "john", us_destination = "el paso", voltage = "500", last_update_on = "january 10", port_of_entry = "lax", msnbr = machine_hash['msnbr'], description = "machine description", location=machine_hash['location'], model=machine_hash['model'], age=15, price=machine_hash['price'], active=true, division=division, product_group=product_group, machine_type=machine_type, brand=brand ) machine.save() @step(u'i should see "([^"]*)" machines') def i_should_see_n_machines(step, n): selector = "#left-main ol li" elements = world.browser.find_elements_by_css_selector(selector) if len(elements) != int(n): raise exception("error: number of machines not match: %d != %d" % (len(elements), int(n))) @step(u'the machines should in next order:') def the_machines_should_be_in_the_following_order(step): selector = "#left-main ol li" elements = world.browser.find_elements_by_css_selector(selector) in range(0, len(elements)): el_text = elements[i].find_element_by_css_selector(".name").text if step.hashes[i]['model'] != el_text: print "fail" else: print el_text print step.hashes[i]['model'] settings
# django settings stiles_aml project. import os.path root = os.path.dirname(__file__).replace('\\','/') debug = false template_debug = debug admins = ( *** ) managers = admins databases = { *** } # local time zone installation. choices can found here: # http://en.wikipedia.org/wiki/list_of_tz_zones_by_name # although not choices may available on operating systems. # on unix systems, value of none cause django utilize same # timezone operating system. # if running in windows environment must set same # scheme time zone. time_zone = 'america/detroit' # language code installation. choices can found here: # http://www.i18nguy.com/unicode/language-identifiers.html language_code = 'en-us' site_id = 1 # if set false, django create optimizations not # load internationalization machinery. use_i18n = true # if set false, django not format dates, numbers , # calendars according current locale. use_l10n = true # if set false, django not utilize timezone-aware datetimes. use_tz = true # absolute filesystem path directory hold user-uploaded files. # example: "/home/media/media.lawrence.com/media/" media_root = root + '/../media/' # url handles media served media_root. create sure utilize # trailing slash. # examples: "http://media.lawrence.com/media/", "http://example.com/media/" media_url = '/media/' # absolute path directory static files should collected to. # don't set in directory yourself; store static files # in apps' "static/" subdirectories , in staticfiles_dirs. # example: "/home/media/media.lawrence.com/static/" static_root = root + '/../static/' # url prefix static files. # example: "http://media.lawrence.com/static/" static_url = '/static/' # additional locations of static files staticfiles_dirs = ( # set strings here, "/home/html/static" or "c:/www/django/static". # utilize forwards slashes, on windows. # don't forget utilize absolute paths, not relative paths. root + "/../shared_static", ) # list of finder classes know how find static files in # various locations. staticfiles_finders = ( 'django.contrib.staticfiles.finders.filesystemfinder', 'django.contrib.staticfiles.finders.appdirectoriesfinder', # 'django.contrib.staticfiles.finders.defaultstoragefinder', ) # create unique, , don't share anybody. secret_key = '***' # list of callables know how import templates various sources. template_loaders = ( 'django.template.loaders.filesystem.loader', 'django.template.loaders.app_directories.loader', ) template_context_processors = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', 'django.core.context_processors.static', ) middleware_classes = ( 'django.middleware.common.commonmiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', # 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', 'django.middleware.gzip.gzipmiddleware', 'debug_toolbar.middleware.debugtoolbarmiddleware', ) root_urlconf = '***_aml.urls' # python dotted path wsgi application used django's runserver. wsgi_application = '***_aml.wsgi.application' template_dirs = ( # set strings here, "/home/html/django_templates" or "c:/www/django/templates". # utilize forwards slashes, on windows. # don't forget utilize absolute paths, not relative paths. root + '/../templates' ) # sentry key sentry_dsn = '****' installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.humanize', # 3rd party 'south', 'debug_toolbar', 'tastypie', 'django_extensions', 'shell_plus', 'raven.contrib.django', 'django_nose', 'lettuce.django', # authored 'website', ) # email settings email_host = '****' request_quote_email = ['****'] python django integration-testing lettuce
Comments
Post a Comment