Skip to content

Commit 4fea6bf

Browse files
Bordahhsecond
andauthored
app: update doctest_skip (#15997)
simple Co-authored-by: hhsecond <[email protected]>
1 parent 5e705fa commit 4fea6bf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/lightning_app/components/serve/python_server.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import uvicorn
99
from fastapi import FastAPI
10-
from lightning_utilities.core.imports import compare_version
10+
from lightning_utilities.core.imports import compare_version, module_available
1111
from pydantic import BaseModel
1212

1313
from lightning_app.core.work import LightningWork
@@ -16,12 +16,9 @@
1616

1717
logger = Logger(__name__)
1818

19-
__doctest_skip__ = ["PythonServer", "PythonServer.*"]
20-
21-
2219
# Skip doctests if requirements aren't available
23-
if not _is_torch_available():
24-
__doctest_skip__ += ["PythonServer", "PythonServer.*"]
20+
if not module_available("lightning_api_access") or not _is_torch_available():
21+
__doctest_skip__ = ["PythonServer", "PythonServer.*"]
2522

2623

2724
def _get_device():

0 commit comments

Comments
 (0)