Skip to content

Commit 9caec98

Browse files
merydiankoebi
andauthored
fix: check api key before running tests (#360)
Co-authored-by: Jakob Schnell <[email protected]>
1 parent c6df467 commit 9caec98

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ RELEASING:
4949
### Fixed
5050
- Delete annotations when plugin is uninstalled ([#346](https://github.com/GIScience/orstools-qgis-plugin/issues/346))
5151
- Reset hand cursor after deactivating line tool ([#342](https://github.com/GIScience/orstools-qgis-plugin/issues/342))
52+
- Check API key being set before running tests ([#358](https://github.com/GIScience/orstools-qgis-plugin/issues/358))
5253
- Set url slashes correctly with optimization requests in procs ([#347](https://github.com/GIScience/orstools-qgis-plugin/issues/347))
5354
- Qt6 incompatibility with QVariant ([#355](https://github.com/GIScience/orstools-qgis-plugin/issues/355))
5455
- Switch to QgsBlockingNetworkRequest ([#117](https://github.com/GIScience/orstools-qgis-plugin/issues/117))

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def pytest_sessionstart(session):
1818
Called after the Session object has been created and
1919
before performing collection and entering the run test loop.
2020
"""
21+
if not os.environ.get("ORS_API_KEY"):
22+
raise ValueError(
23+
"No API key found in environment variables. Please set ORS_API_KEY environment variable to run tests."
24+
)
2125
if data["providers"][0]["key"] == "":
2226
data["providers"][0]["key"] = os.environ.get("ORS_API_KEY")
2327
s.setValue("ORStools/config", data)

0 commit comments

Comments
 (0)