Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

This plugin may cause : AttributeError: 'DoctestItem' object has no attribute 'fixturenames' in test-suite #48

Open
janko-j1 opened this issue Sep 20, 2020 · 0 comments

Comments

@janko-j1
Copy link

When testing another python package (ordered-set) with pytest-salt installed, the test-suite fails with the mentioned AttributeError.

The attached patch solved the issue. Please let me know if you need more information. The patch is based on the same issue as in pytest-dev/pytest-cov#200

Patch:

--- a/pytestsalt/fixtures/daemons.py 2020-09-20 16:16:37.202897106 +0200
+++ b/pytestsalt/fixtures/daemons.py 2020-09-20 16:16:52.689563674 +0200
@@ -1658,7 +1658,7 @@
Fixtures injection based on markers
'''
for fixture in ('salt_master', 'salt_minion', 'salt_call', 'salt', 'salt_key', 'salt_run'):

  •    if fixture in item.fixturenames:
    
  •    if fixture in getattr(item, 'fixturenames', ()):
           after_start_fixture = '{}_after_start'.format(fixture)
           if after_start_fixture not in item.fixturenames:
               item.fixturenames.append(after_start_fixture)
    
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant