Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Local Tests #240

Merged
merged 2 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/deps_eager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ jobs:
run: pytest -rs --cov=./optimade/ --cov-report=xml
env:
OPTIMADE_CI_FORCE_MONGO: 1
OPTIMADE_CONFIG_FILE: ${{ github.workspace }}/tests/test_config.json

- name: Run tests relevant for index meta-db (using `mongomock`)
run: pytest -rs --cov=./optimade/ --cov-report=xml --cov-append tests/server/test_middleware.py tests/server/test_server_validation.py tests/server/test_config.py
env:
OPTIMADE_CI_FORCE_MONGO: 0
OPTIMADE_CONFIG_FILE: ${{ github.workspace }}/tests/test_config.json

# deps_clean-install:
# runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deps_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ jobs:
run: pytest -rs --cov=./optimade/ --cov-report=xml
env:
OPTIMADE_CI_FORCE_MONGO: 1
OPTIMADE_CONFIG_FILE: ${{ github.workspace }}/tests/test_config.json

- name: Run tests only for index meta-db (using `mongomock`)
run: pytest -rs --cov=./optimade/ --cov-report=xml --cov-append tests/server/test_middleware.py tests/server/test_server_validation.py tests/server/test_config.py
env:
OPTIMADE_CI_FORCE_MONGO: 0
OPTIMADE_CONFIG_FILE: ${{ github.workspace }}/tests/test_config.json

- name: Upload coverage to Codecov
if: matrix.python-version == 3.7 && github.repository == 'Materials-Consortia/optimade-python-tools'
Expand Down
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import pytest
from pathlib import Path


def pytest_configure(config):
"""
Method that runs before pytest collects tests so no modules
are imported
"""
cwd = Path(__file__).parent
os.environ["OPTIMADE_CONFIG_FILE"] = str(cwd / "test_config.json")