mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
backups: tests: Fix issue with usage of fixture 'needs_root'
Fixtures cannot be currently included into other fixtures by using
@pytest.mark.fixtures('fixture_name')
They have to be included as parameters instead.
See bug: https://github.com/pytest-dev/pytest/issues/3664
Also increase the scope of needs_root to the highest, i.e. session, so that it
can be used by any kind of fixture.
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
2 files changed
+59
-33
No files matched your search
+1
-1
@@ -64,7 +64,7 @@ def fixture_develop_mode(load_cfg):
|
||||
load_cfg.develop = False
|
||||
|
||||
|
||||
@pytest.fixture(name='needs_root')
|
||||
@pytest.fixture(name='needs_root', scope='session')
|
||||
def fixture_needs_root():
|
||||
"""Skip test if not running in root mode."""
|
||||
if os.geteuid() != 0:
|
||||
|
||||
Reference in new issue
Block a user