pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

upgrade pytest-bdd-2.16.0 to pytest-bdd-2.16.1 gives Plugin already registered: session

Open ghost opened this issue 9 years ago • 9 comments

When generating missing

--generate-missing --feature

all works good with Python 2.7.12, pytest-2.9.2, py-1.4.32, pluggy-0.3.1, pytest-bdd-2.16.0

but when I do same thing with Python 2.7.12, pytest-2.9.2, py-1.4.32, pluggy-0.3.1, pytest-bdd-2.16.1 or the latest 2.18.1

I get:

.7/site-packages/_pytest/vendored_packages/pluggy.py", line 350, in register (plugin_name, plugin, self._name2plugin)) ValueError: Plugin already registered: session

also fails with bdd-2.18.1 + pytest 3.0.5

ghost avatar Dec 21 '16 19:12 ghost

I am getting this too. I downgraded to pytest-bdd 2.16.0 and it worked fine. I am using Python 2.7.13 on Windows 10.

mattjhussey avatar Feb 26 '17 10:02 mattjhussey

I've had a little look and the commit that causes this behaviour to begin for me is: be79c1d534634baeacddb1098e97988c9df8e9fb

mattjhussey avatar Feb 26 '17 11:02 mattjhussey

I've had a little look and put in some debug. It looks like pytest registers the module under test during setup and then it gets registered again during pytest-bdd running and this causes the error. I can't see why though.

mattjhussey avatar Feb 26 '17 11:02 mattjhussey

@pouledodue is it still a case with the newest bdd?

olegpidsadnyi avatar Feb 13 '18 12:02 olegpidsadnyi

I get this error with the latest version of pytest-bdd (3.0.1) and pytest (4.1.0)

lib/python3.7/site-packages/pluggy/manager.py", line 80, in register % (plugin_name, plugin, self._name2plugin) ValueError: Plugin already registered: session=<Session tests>

michaelnt avatar Jan 10 '19 14:01 michaelnt

I likewise get this error with pytest-bdd-3.1.0 and pytest 4.4.1. Nothing else in my virtualenv.

pfctdayelise avatar Apr 26 '19 04:04 pfctdayelise

Are there any news? It's still happen using pytest-bdd-3.1.1 and pytest 5.0.1

EveAndElse avatar Aug 02 '19 07:08 EveAndElse

I think I found the issue and posted a comment to that effect. https://github.com/pytest-dev/pytest-bdd/commit/be79c1d534634baeacddb1098e97988c9df8e9fb#r34811134

I will post a pull request shortly

jamesharris-garmin avatar Aug 23 '19 15:08 jamesharris-garmin

I think I found the issue. But I wonder how useful it is since the command doesn't seem to actually generate the template files. It just prints what the templates should be.

jamesharris-garmin avatar Aug 23 '19 15:08 jamesharris-garmin