Skip to content

Commit

Permalink
test: assert package version found (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp authored Aug 5, 2024
1 parent e7dfd07 commit 78a48bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,3 @@ jobs:
- name: Test with pytest
run: |
pytest
env:
GITHUB_ACTIONS: true

5 changes: 3 additions & 2 deletions powerplantmatching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
# e.g. "0.5.15", without the post part (if it exists, otherwise the same as __version__)
latest_release = __version__.split(".post")[0]

assert latest_release != "0.1", "setuptools_scm could not find the version number"

assert not __version__.startswith(
"0.0"
), "Could not determine version of powerplantmatching."

__all__ = [
"powerplants",
Expand Down
13 changes: 2 additions & 11 deletions test/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
@author: fabian
"""

import os

import pytest

import powerplantmatching as pm
Expand All @@ -19,11 +17,6 @@
sources.remove("ENTSOE")


@pytest.fixture(scope="session")
def is_github_actions():
return os.environ.get("GITHUB_ACTIONS") == "true"


@pytest.mark.parametrize("source", sources)
def test_data_request_raw(source):
func = getattr(data, source)
Expand Down Expand Up @@ -59,10 +52,8 @@ def test_OPSD_VRE_country():


@pytest.mark.github_actions
def test_url_retrieval(is_github_actions):
# Leads to HTTPError in GitHubAction
if not is_github_actions:
pm.powerplants(from_url=True)
def test_url_retrieval():
pm.powerplants(from_url=True)


def test_reduced_retrieval():
Expand Down

0 comments on commit 78a48bc

Please sign in to comment.