diff options
author | Ashley Camba Garrido <ashwoods@gmail.com> | 2017-10-10 15:21:33 +0200 |
---|---|---|
committer | Ashley Camba <ashwoods@gmail.com> | 2017-10-10 23:19:00 +0200 |
commit | 1c0628406e3ee3cc58d9c379980784cbf5a4947a (patch) | |
tree | b677142738688c06606ea737dad0b20cc123544a /conftest.py | |
parent | 7a3fab9f5aa463e3643305844a1152f432b44758 (diff) | |
download | raven-1c0628406e3ee3cc58d9c379980784cbf5a4947a.tar.gz |
refactor(tests) Use marker to skip tests that depend on a git repo
Diffstat (limited to 'conftest.py')
-rw-r--r-- | conftest.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/conftest.py b/conftest.py index 2475876..53a8b88 100644 --- a/conftest.py +++ b/conftest.py @@ -61,4 +61,11 @@ def mytest_model(): @pytest.fixture(scope='function', autouse=False) def user_instance(request, admin_user): - request.cls.user = admin_user
\ No newline at end of file + request.cls.user = admin_user + + +@pytest.fixture(autouse=True) +def has_git_requirements(request, project_root): + if request.node.get_marker('has_git_requirements'): + if not os.path.exists(os.path.join(project_root, '.git', 'refs', 'heads', 'master')): + pytest.skip('skipped test as project is not a git repo') |