Thank you for the reply. 
Regarding this bug report, I did a simple test and I cannot reproduce it.
It seems that the "before_feature" is always called even if you execute a 
single "Scenario".
I need to dig a little bit more to understand what fails in your case.

For the record, the description of the special "data" attribute is documented 
here: 
https://github.com/florentx/openobject-mirliton/tree/buildout/features#readme
"ctx.data -- data dictionary in the Feature scope"

Its purpose is to replicate the "memorizer" pattern found in legacy 
OERPScenario features:
http://bazaar.launchpad.net/~camptocamp/oerpscenario/6.1/view/head:/lib/ERPConnector.rb#L48

I know it is not the best design decision regarding the BDD guidelines because 
Scenarios should be independant.
But there were some Features which were relying on this (data initialization, 
complex cases, etc...). And we would like to lower the barrier for migrating 
our legacy Features from Ruby to Python.

This attribute ctx.data is also used to pass all kind of records or data
between steps of the same Scenario. (even if you can create any
attribute on the ctx object if you like: they don't leak between
scenarios).

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OERPScenario.
https://bugs.launchpad.net/bugs/1154208

Title:
  ctx.data not initialized when executing a step

Status in OpenERP Scenario : Functional tests by Camptocamp:
  New

Bug description:
  Hi,

  ctx.data is initialized inside before_feature (environment.py). However, the 
before_feature method is only called when running a feature, it's not called 
when executing only one step.
  Can you please ensure ctx.data is initialized in before_step, e.g.
  |      if not hasattr(ctx,'data'):
  |          ctx.data = {}

  By the way, what's the purpose of that data dict?

  kr,
  J-E

To manage notifications about this bug go to:
https://bugs.launchpad.net/oerpscenario/+bug/1154208/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to