summaryrefslogtreecommitdiff
path: root/conftest.py
diff options
context:
space:
mode:
authorAshley Camba Garrido <ashwoods@gmail.com>2017-10-10 15:21:33 +0200
committerAshley Camba <ashwoods@gmail.com>2017-10-10 23:19:00 +0200
commit1c0628406e3ee3cc58d9c379980784cbf5a4947a (patch)
treeb677142738688c06606ea737dad0b20cc123544a /conftest.py
parent7a3fab9f5aa463e3643305844a1152f432b44758 (diff)
downloadraven-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.py9
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')