Python ExceptionWrapper错误刷新

Python ExceptionWrapper错误刷新,python,bdd,nose,nosetests,Python,Bdd,Nose,Nosetests,我使用了一个模糊的错误 这是我的档案: user.feature: Feature: user In order for things to work We need to be able to retrieve users From the Database Scenario Outline: Retrieve a user using ID Given I have the account number <account_number> And

我使用了一个模糊的错误

这是我的档案:

user.feature:

Feature: user
  In order for things to work
  We need to be able to retrieve users
  From the Database

  Scenario Outline: Retrieve a user using ID
    Given I have the account number <account_number>
    And I have the user id <user_id>
    Then the users <field_name> should be <field_value>

  Examples:
   | account_number | user_id | field_name | field_value | 
   | 57             | 28967  |username   | user101 |

如果有人有任何想法,我将感谢任何意见

可能还为时过早,但我想我找到了答案

Feature: user
  In order for things to work
  We need to be able to retrieve users
  From the Database

  Scenario Outline: Retrieve a user using ID
    Given I have the account number <account_number>
    And I have the user id <user_id>
    Then the users <field_name> should be <field_value>

  Examples:
   | account_number | user_id | field_name | field_value | 
   | 57             | 28967  |username   | user101 |
from freshen import *
from freshen.checks import *

import user_operations


appid = "12345"
secret = "54321"
api_root = "http://api.stuff.com/"

@Before
def before(sc):
    scc.headers = {'Content-Type':'application/json','Accept':'application/json'}
    token, scope = user_operations.get_auth_token_and_scope(api_root, appid, secret, scc.headers)#Needs test in itself
    scc.headers['Authorization'] = 'Pbnb ' + token
    scc.result = None

@Given("I have the account number (\d+)")
def set_account_num(account_number):
    scc.account_number = int(account_number)

@Given("I have the user id (\d+)")
def set_user_id(user_id):
    scc.user_id = int(user_id)

@Then("the users (.*) should be (.*)")
def check_result(field_name, field_value):
    user = user_operations.get_user(scc.account_number, scc.user_id, "id", scc.headers)
    assert_equal(str(field_value), user[str(field_name)])
I can work-around this with the patch below.

--- noseplugin.py.orig  2011-07-22 18:34:11.000000000 +0200
+++ noseplugin.py   2011-07-22 18:34:31.000000000 +0200
@@ -70,8 +70,6 @@
                 self.step_runner.run_step(step)
             except (AssertionError, UndefinedStepImpl, ExceptionWrapper):
                 raise
-            except:
-                raise ExceptionWrapper(sys.exc_info(), step)

             for hook_impl in reversed(self.step_registry.get_hooks('after_step', self.scenario.get_tags())):
                 hook_impl.run(self.scenario)

cheers,
serafeim