Skip to content

Commit

Permalink
exclude api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serengil committed Feb 4, 2024
1 parent 2e17047 commit 1ca17d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
9 changes: 1 addition & 8 deletions api/src/app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# 3rd parth dependencies
from flask import Flask

try:
# unit tests
from api.src.modules.core.routes import blueprint
except:
# runtime
from modules.core.routes import blueprint

from modules.core.routes import blueprint

def create_app():
app = Flask(__name__)
Expand Down
9 changes: 1 addition & 8 deletions api/src/modules/core/routes.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
from flask import Blueprint, request

try:
# unit tests
from api.src.modules.core import service
except:
# runtime
from modules.core import service

from modules.core import service
from deepface.commons.logger import Logger

logger = Logger(module="api/src/routes.py")
Expand Down
7 changes: 6 additions & 1 deletion tests/test_api.py → tests/testing_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
import unittest
from deepface.commons import constant
from deepface.commons.logger import Logger

from api.src.app import create_app
# api is not available under deepface import
sys.path.insert(1, f"{constant.ROOT_DIR}/api/src")
# pylint: disable=wrong-import-order, wrong-import-position
from app import create_app

logger = Logger("tests/test_api.py")

Expand Down

0 comments on commit 1ca17d7

Please sign in to comment.